sub A { local $x = 3; &B; } sub B{ $x } my $x = 2; print &A; #prints 3 not 2