in reply to Re^3: conditional catch-blocks 'try {} catch(COND) { }'
in thread conditional catch-blocks 'try {} catch(COND) { }'

> Syntax::Keyword::Try

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