Perl with -p doesn't die if a file doesn't exist
Right you are; a workaround is
qwurx [shmem] ~ > perl -p -e 'BEGIN{$SIG{__WARN__}=sub{die@_}}' nonexi +stent Can't open nonexistent: No such file or directory. qwurx [shmem] ~ > echo $? 2
In reply to Re^2: Capture error from one-liner
by shmem
in thread Capture error from one-liner
by dirtdog
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |