in reply to Die and Exit Codes

Read perlfunc :) It states:
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.
Example:
rhesa@schutz:~$ perl -e '$!=3; die "whoa: $!"' whoa: No such process at -e line 1. rhesa@schutz:~$ echo "exit=$?" exit=3

Replies are listed 'Best First'.
Re^2: Die and Exit Codes
by pileofrogs (Priest) on Nov 30, 2006 at 21:44 UTC
    Oh, for some reason I was convinced i couldn't set $!...

    Thanks!
    --Pileofrogs