15 sub bound { removed() }
16 delete $main::{removed};
17 is( bound(), 23, 'function still bound' );
18 ok( !main->can('removed'), 'function not available as method' );
21 sub replaced { 'func' }
22 is( replaced(), 'func', 'original function still bound' );
23 is( main->replaced, 'meth', 'method is replaced function' );
24 BEGIN { delete $main::{replaced} }
25 sub replaced { 'meth' }
30 sub bound2 { removed2() }
31 undef $main::{removed2};
33 like( $@, qr/Undefined subroutine &main::removed2 called/,
34 'function not bound' );
35 ok( !main->can('removed2'), 'function not available as method' );
38 sub replaced2 { 'func' }
39 is( replaced2(), 'meth', 'original function not bound, was replaced' );
40 ok( main->replaced2 eq 'meth', 'method is replaced function' );
41 BEGIN { undef $main::{replaced2} }
42 sub replaced2 { 'meth' }