From: Peter Rabbitson Date: Thu, 4 Jul 2013 09:42:24 +0000 (+0200) Subject: The construct introduced in 2b0d579d8 confuses perl 5.6 - simplify X-Git-Tag: Try-Tiny-0.13~6^2~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3db0dca6ba5285697d99f3beb1dfd2437d0c5e9a;p=p5sagit%2FTry-Tiny.git The construct introduced in 2b0d579d8 confuses perl 5.6 - simplify --- diff --git a/lib/Try/Tiny.pm b/lib/Try/Tiny.pm index 3331660..8e8dd02 100644 --- a/lib/Try/Tiny.pm +++ b/lib/Try/Tiny.pm @@ -69,9 +69,10 @@ sub try (&;@) { }; return 1; # properly set $fail to false - } and $error = $@; + }; - # reset the original value of $@ + # preserve the current error and reset the original value of $@ + $error = $@; $@ = $prev_error; # set up a scope guard to invoke the finally block at the end