Exception handling syntax: Difference between revisions

Content deleted Content added
m Perl 5: Added Nice::Try as a module that fully implements try-catch blocks in perl
Line 797:
Several modules in the Comprehensive Perl Archive Network ([[CPAN]]) expand on the basic mechanism:
* {{Perl2|Error}} provides a set of exception classes and allows use of the try/throw/catch/finally syntax.
* {{Perl2|TryCatch}} and, {{Perl2|Try::Tiny}} bothand {{Perl2|Nice::Try}} all allow the use of try/catch/finally syntax instead of boilerplate to handle exceptions correctly.
* {{Perl2|Exception::Class}} is a base class and class-maker for derived exception classes. It provides a full structured [[stack trace]] in {{Perl2|$@->trace}} and {{Perl2|$@->trace->as_string}}.
* {{Perl2|Fatal}} overloads previously defined functions that return true/false e.g., {{Perl2|open}}, {{Perl2|close}}, {{Perl2|read}}, {{Perl2|write}}, etc. This allows built-in functions and others to be used as if they threw exceptions.