Jeff Pang wrote:
From: Xavier Noria <[EMAIL PROTECTED]>
On Aug 13, 2007, at 9:29 AM, Jeff Pang wrote:
Does die call exit when it's excuted?
If so,when I overwrote exit() function in my script,would die call
this customized
exit?
Do you want some code executed if the program dies?
No.I just want to see if die call exit in perl core.
I saw scripts under modperl import Apache::exit but don't import something like
Apache::die.So I think maybe die has called exit when it excuted.
perldoc -f die
die LIST
Outside an "eval", prints the value of LIST to "STDERR" and exits
^^^^^
with the current value of $! (errno). If $! is 0, exits with the
^^^^^
value of "($? >> 8)" (backtick ‘command‘ status). If "($? >> 8)"
is 0, exits with 255. Inside an "eval()," the error message is
^^^^^
stuffed into $@ and the "eval" is terminated with the undefined
value. This makes "die" the way to raise an exception.
perldoc -f exit
exit EXPR
exit Evaluates EXPR and exits immediately with that value. Example:
$ans = <STDIN>;
exit 0 if $ans =~ /^[Xx]/;
See also "die".
John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/