perlfunc/eval: $@ is now set after unwinding
authorFather Chrysostomos <sprout@cpan.org>
Fri, 11 Feb 2011 21:46:47 +0000 (13:46 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 11 Feb 2011 22:07:24 +0000 (14:07 -0800)
pod/perlfunc.pod

index 654ea85..ece1005 100644 (file)
@@ -1676,8 +1676,8 @@ normally you I<would> 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