$foo = bar(@params); # You don't know what value $foo has { local $foo = 1; foo(); } sub foo { print "foo: $foo\n"; } # now $foo is restored!