1#!/usr/bin/perl 2 3use strict; 4use warnings; 5 6require q(./test.pl); plan(tests => 1); 7 8=pod 9 10This tests the use of an eval{} block to wrap a next::method call. 11 12=cut 13 14{ 15 package AA; 16 use mro 'c3'; 17 18 sub foo { 19 die 'AA::foo died'; 20 return 'AA::foo succeeded'; 21 } 22} 23 24{ 25 package BB; 26 use base 'AA'; 27 use mro 'c3'; 28 29 sub foo { 30 eval { 31 return 'BB::foo => ' . (shift)->next::method(); 32 }; 33 34 if ($@) { 35 return $@; 36 } 37 } 38} 39 40like(BB->foo, 41 qr/^AA::foo died/, 42 'method resolved inside eval{}'); 43 44 45