$ perl -l use strict; use warnings; our $x = 3; foo(7); sub foo { my $oldx=$x; local $x = shift; print $x; print $oldx; }