6 use Test::More tests => 10 + 5 + 6;
8 use Scope::Upper qw<localize UP HERE>;
12 sub loc { local $x; my $y = $_[0]; localize '$x', $y => $_[1] }
21 is($x, 8, 'not localized');
23 is($x, 9, 'not localized');
25 is($x, 1, 'localized to 1');
27 is($x, 1, 'localized to 1');
29 is($x, 1, 'localized to 1');
31 is($x, 10, 'localized to undef');
33 is($x, 1, 'localized to 1');
35 is($x, 1, 'localized to 1');
47 is($x, 8, 'not localized');
50 is($x, 2, 'localized to 2');
52 is($x, 1, 'localized to 1');
63 is($x, undef, 'not localized');
66 is($x, undef, 'not localized');
68 is($x, 2, 'localized to 2');
70 is($x, 1, 'localized to 1');