avoid eval misinterpretation on old perls
authorZefram <zefram@fysh.org>
Sun, 18 Aug 2013 13:41:52 +0000 (14:41 +0100)
committerZefram <zefram@fysh.org>
Sun, 18 Aug 2013 13:41:52 +0000 (14:41 +0100)
An eval-BLOCK in the Carp test suite is misinterpreted by perl 5.6 as an
eval-STRING.  Add a do-BLOCK wrapper inside the block to satisfy perl 5.6.

dist/Carp/t/Carp.t

index f51bd11..f513760 100644 (file)
@@ -95,7 +95,7 @@ is( $info{sub_name}, "eval '$eval'", 'caller_info API' );
 
 # test for '...::CARP_NOT used only once' warning from Carp
 my $warning;
-eval {
+eval { do {
     BEGIN {
         local $SIG{__WARN__} = sub {
             if   ( defined $^S ) { warn $_[0] }
@@ -108,7 +108,7 @@ eval {
     BEGIN {
         eval { Carp::croak() };
     }
-};
+} };
 ok !$warning, q/'...::CARP_NOT used only once' warning from Carp/;
 
 # Test the location of error messages.