Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- PERL 4.0 Reference Guide - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

     die(LIST)

     die LIST

             Outside of 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)  (`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.

             Equivalent examples:

                  die "Can't cd to spool: $!\n"
                       unless chdir '/usr/spool/news';

                  chdir '/usr/spool/news' || die "Can't cd to spool: $!\n"


             If the value of EXPR does not end in a newline,  the
             current script line number and input line number (if
             any) are also printed, and a  newline  is  supplied.
             Hint:  sometimes  appending ", stopped" to your mes-
             sage will cause it to make  better  sense  when  the
             string  "at  foo line 123" is appended.  Suppose you
             are running script "canasta".

                  die "/etc/games is no good";
                  die "/etc/games is no good, stopped";

             produce, respectively

                  /etc/games is no good at canasta line 123.
                  /etc/games is no good, stopped at canasta line 123.

See Also: exit warn

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson