in reply to Re^2: Confusion with finding strings in command output
in thread Confusion with finding strings in command output
I know that standard error is being redirected. Do look again at OP's code (simplified)...
my $SUCCESS = 0; my %Error = ( q[No such file or directory] => 1 ); my @out = qx { command here 2>&1 }; my $rc = $?; if ( $rc == $SUCCESS ) { # As I wrote earlier, if command was sucessful, then why would # there be no-file-found error (under normal conditions)? Else, # exit code cannot be trusted. ... = grep { $Error{$_} } @out; ... } ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Confusion with finding strings in command output
by Laurent_R (Canon) on Aug 30, 2014 at 20:37 UTC |