in reply to Exception clauses
you can use Try::Tiny or Syntax::Keyword::Try module. From the synopis of the modules:
use Try::Tiny; # handle errors with a catch handler try { die "foo"; } catch { warn "caught error: $_"; # not $@ }; # or use Syntax::Keyword::Try; sub foo { try { attempt_a_thing(); return "success"; } catch { warn "It failed - $@"; return "failure"; } }
Also look at ModernPerl book in the chapter dedicated to Exceptions.
L*
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Exception clauses
by bliako (Abbot) on Jun 06, 2019 at 10:24 UTC |