From: awalker Date: Wed, 22 Jan 2014 19:02:56 +0000 (-0500) Subject: second example now behaves the same as the first X-Git-Tag: Try-Tiny-0.19~5^2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d7aab6fa058ad3bb313a70008a26cc9f3d39b456;p=p5sagit%2FTry-Tiny.git second example now behaves the same as the first --- diff --git a/lib/Try/Tiny.pm b/lib/Try/Tiny.pm index 588451c..a4ffcfb 100644 --- a/lib/Try/Tiny.pm +++ b/lib/Try/Tiny.pm @@ -500,9 +500,7 @@ Instead, you should capture the return value: say "This text WILL NEVER appear!"; } - - # or - + # OR sub parent_sub_with_catch { my $success = try { die; @@ -512,6 +510,9 @@ Instead, you should capture the return value: # do something with $_ return undef; #see note }; + return unless $success; + + say "This text WILL NEVER appear!"; } Note that if you have a C block, it must return C for this to work,