From: Father Chrysostomos Date: Fri, 11 Feb 2011 21:46:47 +0000 (-0800) Subject: perlfunc/eval: $@ is now set after unwinding X-Git-Tag: accepted/trunk/20130322.191538~5704 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b208c909347c1ee277714eaa1bda5a4e0d85a64e;p=platform%2Fupstream%2Fperl.git perlfunc/eval: $@ is now set after unwinding --- diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 654ea85..ece1005 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -1676,8 +1676,8 @@ normally you I like to use double quotes, except that in this particular situation, you can just use symbolic references instead, as in case 6. -The assignment to C<$@> occurs before restoration of localised variables, -which means a temporary is required if you want to mask some but not all +Before Perl 5.14, the assignment to C<$@> occured before restoration of localised variables, which means that, if your code is to run on older +versions, a temporary is required if you want to mask some but not all errors: # alter $@ on nefarious repugnancy only @@ -1686,7 +1686,7 @@ errors: { local $@; # protect existing $@ eval { test_repugnancy() }; - # $@ =~ /nefarious/ and die $@; # DOES NOT WORK + # $@ =~ /nefarious/ and die $@; # Perl 5.14 and higher only $@ =~ /nefarious/ and $e = $@; } die $e if defined $e