$foo = "main scope"; { local $foo = "temp scope"; print "\$foo is $foo\n"; } print "\$foo now $foo\n"; __output__ $foo is temp scope $foo now main scope