I did this in tcsh:

> perl -le 'exit(2); sub END {system("date");}' ; echo $status
Mon May 17 11:09:43 MDT 2010
0

In other words, the return value of the date command in an END subroutine
overrides my desired exit value.

How do I fix this? I want to tell Perl: if I explicitly do exit($foo), I
want the script to exit with status $foo?

-- 
We're just a Bunch Of Regular Guys, a collective group that's trying
to understand and assimilate technology. We feel that resistance to
new ideas and technology is unwise and ultimately futile.

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to