in reply to ClearCase Command text in Backticks is ignored

Are you sure $stream is set to what you think it is?

If you don't need to capture output and just want it to go to stdout, use system(@array):

# Not sure if you are trying to pass literal '\t','\n' or tab and newl +ine characters...assuming tab and newline system(cleartool => 'lsco', '-r', '-brt', $stream, '-fmt', "%En\t%u\n" +);

If you want to capture stdout, open a file handle to the command:

open(my $fh, "-|", cleartool => 'lsco', '-r', '-brt', $stream, '-fmt', "%En\t%u\n") or +die "Err: $!"; while (<$fh>) { print "OUTPUT: $_"; } close $fh or die "Error: $!";

Replies are listed 'Best First'.
Re^2: ClearCase Command text in Backticks is ignored
by Deep_Plaid (Acolyte) on May 08, 2013 at 16:56 UTC

    I see what you mean, Ken. I was thinking System passed the output of the command to the variable $output, but I do remember reading now that it passes the error code. I had thought I was printing the output of system, but it was actually passing the error code! I removed the printf and all is good. Thanks again. You guys rock! I'm a newbie, obviously.