this may be a dumb question, but why is the $e in catch ($e) explicitly needed?
use Syntax::Keyword::Try; sub foo { try { attempt_a_thing(); return "success"; } catch ($e) { warn "It failed - $e"; return "failure"; } }
To avoid reusing/redefining a special variable like Try::Tiny does with $_ ?
We already have $@
Or is there another reason I'm not aware of?
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
In reply to Re^4: conditional catch-blocks 'try {} catch(COND) { }'
by LanX
in thread conditional catch-blocks 'try {} catch(COND) { }'
by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |