Content deleted Content added
→Perl 5: going through examples on this page, most of them seem to be done in-scope, yet here is an unsourced complaint about taking things out of scope; use case should be demonstrated and all langs treated accordingly |
|||
Line 744:
=== Perl 5===
{{Further information|Perl}}
The [[Perl]] mechanism for exception handling uses {{Perl2|die}} to throw an exception when wrapped inside an {{Perl2|eval { ... };}} block. After the {{Perl2|eval}}, the special variable {{Perl2|$@}} contains the value passed from {{Perl2|die}}.
Perl 5.005 added the ability to throw objects as well as strings. This allows better introspection and handling of types of exceptions.
|