From: Zefram Date: Sun, 18 Aug 2013 13:41:52 +0000 (+0100) Subject: avoid eval misinterpretation on old perls X-Git-Tag: upstream/5.20.0~2264 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=efc2495a0c8d54eaa2b5e813404a9cff0db3ca9d;p=platform%2Fupstream%2Fperl.git avoid eval misinterpretation on old perls 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. --- diff --git a/dist/Carp/t/Carp.t b/dist/Carp/t/Carp.t index f51bd11..f513760 100644 --- a/dist/Carp/t/Carp.t +++ b/dist/Carp/t/Carp.t @@ -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.