in reply to Re: Try::Tiny not returning error
in thread Try::Tiny not returning error

Hi,
I just tried that, but it didn't give an error at all, not even from Perl.
If I DID want to capture the Perl errors themselves, is that possible though?

Replies are listed 'Best First'.
Re^3: Try::Tiny not returning error
by tangent (Parson) on Feb 13, 2014 at 05:01 UTC
    Sorry, I didn't read your post properly. I don't think Try::Tiny handles warnings (just exceptions) but you can catch them:
    sub set_delim { undef $delim; local $SIG{__WARN__} = sub { die() }; try { ...
    Or you could turn warnings into exceptions:
    sub set_delim { undef $delim; use warnings 'FATAL' => 'all'; try { ...
      Thank you, that worked perfectly.
      That worked perfectly, thank you.