perlcleartool

Perl Cleartool Accept Statement


I am using the following code to execute the ClearCase statement "Accept" from a perl script.

$acceptA = `accept $Component`;

After execution, inside my perl script, the value of $acceptA is blank.

The text displayed on the screen during execution of this line is : "ERROR You do not have permissions to ACCEPT this work."

How do I read this line? I thought it would return into the variable $acceptA as it does with the "cleartool checkin" command?


Solution

  • As i do not know ClearCase and how that accept works, i can only guess. Seeing how it is an error message, it might be written to STDERR instead of STDOUT and backticks only capture STDOUT of the command executed. In that case, redirecting the commands STDERR to STDOUT would work. Try

    $acceptA = `accept $Component 2>&1`
    

    and see if that works in capturing the output in case of error as well.