From efc2495a0c8d54eaa2b5e813404a9cff0db3ca9d Mon Sep 17 00:00:00 2001 From: Zefram Date: Sun, 18 Aug 2013 14:41:52 +0100 Subject: [PATCH] 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. --- dist/Carp/t/Carp.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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. -- 2.7.4