ext/XS-APItest/t/gotosub.t
raw| 1 | #!perl -w |
| 2 | |
| 3 | # Test that goto &xsub provides the right lexical environment. |
| 4 | |
| 5 | use strict; |
| 6 | |
| 7 | use Test::More tests => 1; |
| 8 | use XS::APItest; |
| 9 | |
| 10 | # This sub must remain outside the ‘use warnings’ scope. |
| 11 | sub no_warnings { goto &stringify } |
| 12 | |
| 13 | use warnings; |
| 14 | |
| 15 | $SIG{__WARN__} = sub { like shift, qr\^Use of uninitialized\ }; |
| 16 | |
| 17 | no_warnings(my $x) # undefined variable |