Skip to Content
Programming PERL in the .NET Environment
book

Programming PERL in the .NET Environment

by Yevgeny Menaker, Michael Saltzman, Robert J. Oberg
September 2002
Intermediate to advanced content levelIntermediate to advanced
496 pages
10h
English
Addison-Wesley Professional
Content preview from Programming PERL in the .NET Environment

Exceptions

.NET provides an exception-handling mechanism. As its name implies, this mechanism helps to take care of exceptional situations in our program. Generally, if an error occurs, then the code throws an exception that can be caught by the caller code, even if this is another module or component; that is, exceptions bubble up in the call stack. Fortunately, PerlNET provides a very easy way to work with exceptions. We use die functions and eval blocks to generate and to catch exceptions respectively.

Generating and Catching Exceptions

To generate an exception in the module or any other PerlNET program, we use the die function, passing to it a string with an error description. For example, we may set a rule for our StockItem class that class ...

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

Sams Teach Yourself Perl in 21 Days, Second Edition

Sams Teach Yourself Perl in 21 Days, Second Edition

Laura Lemay, Rafe Colburn
Pro Perl

Pro Perl

Peter Wainwright

Publisher Resources

ISBN: 0130652067Purchase book