$? = ...; doesn't set the exit code.
Works for me:
perl -e 'END{$?=1}' && echo foo # prints nothing perl -e 'END{$?=0}' && echo foo # prints "foo"
You can manipulate $? in an END block. From perlmod:
Inside an "END" code block, $? contains the value that the program is going to pass to "exit()". You can modify $? to change the exit value of the program.
In reply to Re^2: 'Transparent grep'
by almut
in thread 'Transparent grep'
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |