Exceptions: Difference between revisions
→{{header|Perl}}: Reverted 56483 (yes, those are exceptions). Added lang tags.
Underscore (talk | contribs) (→{{header|Perl}}: Reverted 56483 (yes, those are exceptions). Added lang tags.) |
|||
Line 764:
=={{header|Perl}}==
<lang perl># throw an exception
▲ die "Danger, danger, Will Robinson!";
▲ eval {
▲ die "this could go wrong mightily";
▲ };
▲ print $@ if $@;
▲ # rethrow
▲ die $@;
See http://perldoc.perl.org/perlvar.html#%24EVAL_ERROR for the meaning of the special variable <tt>$@</tt>. See http://search.cpan.org/dist/Error for
=={{header|PHP}}==
|