my $foo = "hello"; { # this affects the outer $foo $foo .= " world"; my $foo = "something else"; print "inner foo is $foo\n"; }; print "outer foo is $foo\n"; # produces inner foo is something else outer foo is hello world