in reply to Try::Tiny not returning error

You are undefining $delim and then trying to use it, perl itself is giving you the 'uninitialized value' warning (see perllexwarn). Try instead:
delete $delimiters{$delim};
Update: no that won't throw an exception in this context

Replies are listed 'Best First'.
Re^2: Try::Tiny not returning error
by Audar (Novice) on Feb 13, 2014 at 04:43 UTC
    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?
      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.