$a='one'; $b='two'; sub1(); sub sub1 { local $a = 'three'; my $b = 'four'; sub2(); } sub sub2 { print "\$a: $a\n"; print "\$b: $b\n"; } #### $a: three $b: two