Exceptions/Catch an exception thrown in a nested call: Difference between revisions

Content added Content deleted
(→‎{{header|Perl}}: Both exceptions are caught.)
(→‎{{header|Perl}}: Add note on catching both exceptions.)
Line 1,381: Line 1,381:


=={{header|Perl}}==
=={{header|Perl}}==
{{incorrect|Perl|Both exceptions are caught and one is is re-raised. If this is the only way to do the task then please add a note to this example; otherwise modify to not catch the second exception.}}
Note: Both exceptions are caught and one is re-raised rather than only one being caught.
<lang perl>sub foo {
<lang perl>sub foo {
foreach (0..1) {
foreach (0..1) {