my $ref; { # begin lexical scope my $foo = "something in a lexical scope"; $ref = \$foo; } # end lexical scope print "\$ref refers to: $$ref", $/; print "\$foo is: ", (defined $foo ? $foo : "undefined"), $/; __output__ $ref refers to: something in a lexical scope $foo is: undefined