sub foo { my $s = shift; my $r = \$s; print "FOO ($r)\n" } my $X = "SOMESTRING"; my $O = \$X; my $R = \$X; print "NOTFOO ($R,$O)\n"; foo( $$R );