$! hold the failure message.
quit the program; There’s one more thing that die will do for you: it will automatically append the Perl
program name and line number† to the end of the message, so you can easily identify
which die in your program is responsible for the untimely exit.(give the name and line number)
- @ARGV > 2 or die "not enough";
-
-
not enough at die.pl line 1.
The warn function works just like die does, except for that last step—it doesn’t actually
quit the program. But it adds the program name and line number if needed, and it prints
the message to standard error, just as die would.
阅读(487) | 评论(0) | 转发(0) |