Hi All,

Wondering if someone has feedback on this..

When using backticks to capture the output of an external command, one can
scan each line as it happens, or dump the output into an array and then go
back and take a look.

foreach $line (`$mycmd`) {
if ($line=~/[Ee]rror) { last; }
....

vs.

@cmdoutput=`$mycmd`;
foreach $line (@cmdoutput) {
if ($line=~/[Ee]rror) { last; }
....


I'm wondering if the 'last' statement into the first example above, will
affect, or strand perhaps, the process I started by the backticks?  last
would effectively cease attempts to read data from the command, but the
command hasn't terminated gracefully at this non-completed stage, and in
this case is it just abandoned?  Or will perl clean up after me?

Thanks,

Mark

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to