Skip to Content
Perl Debugged
book

Perl Debugged

by Peter Scott, Ed Wright
March 2001
Intermediate to advanced
288 pages
4h 56m
English
Addison-Wesley Professional
Content preview from Perl Debugged

9.3. Taking Exception to Yourself

Having discussed how we handle exceptions generated by Perl, it's time to talk about how we make exceptions of our own. You're already used to the most basic exception-generating method, which is to call die. The arguments are printed, and your program exits with a nonzero return code. (Just which nonzero return code is documented in gory detail under perldoc -f die.)

You may see some additional text output by die, such as the line number of code it died on. If instead it says (eval 13), it's telling you that it was executing the thirteenth call to eval and prints the line number relative to the evaled code, not the program containing the eval. If it says <FOO> chunk 42, it means that you had the filehandle ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Perl Hacks

Perl Hacks

Chromatic, Damian Conway, Curtis Ovid Poe, Curtis (Ovid) Poe
Pro Perl

Pro Perl

Peter Wainwright
Intermediate Perl

Intermediate Perl

Randal L. Schwartz, brian d foy, Tom Phoenix
Perl Testing: A Developer's Notebook

Perl Testing: A Developer's Notebook

Ian Langworth, Chromatic

Publisher Resources

ISBN: 0201700549Purchase book