in reply to Try::Tiny - return in catch from sub
sub foo { my $error = 0; try { die; } catch { print "error\n"; $error = 1; } return if $error; print "no_err\n"; }
I agree from a program flow point-of-view, it would be better if the return inside the catch worked as expected - it may be that the "catch" is itself similar to a sub, and the return is returning from that?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Try::Tiny - return in catch from sub
by Anonymous Monk on Nov 26, 2010 at 15:03 UTC | |
by mjscott2702 (Pilgrim) on Nov 26, 2010 at 15:34 UTC | |
by Anonymous Monk on Nov 27, 2010 at 10:35 UTC |