Foo.pm ------ use strict; use warnings; sub init { print("Setting \$Foo::bar to 42.\n"); $Foo::bar = 42; } local $Foo::bar; init(); 1;