in reply to Try::Tiny - return in catch from sub
is the same astry { die; } catch { print 'error'; return; # Not very useful! };
&try( sub { die; }, &catch( sub { print 'error'; return; # Not very useful! }, ), );
Placing a return in the the sub you're passing to try or the sub you're passing to catch will only exit that sub (if and when it's called).
Zephram is doing awesome work with the Perl parser which will provide clean means of providing modules like Try::Tiny without this issue.
There currently exists such a module, but it uses some trickier means of doing this.
|
|---|