http://www.perlmonks.org?node_id=927911


in reply to Way to do a "scalar ref"?

\@test_array and \%test_hash becomes \$test_scalar

@$array_ref and %$hash_ref becomes $$scalar_ref

So,

my $test_scalar = 123; print Dumper($test_scalar); test_hash(\$test_scalar); print Dumper($test_scalar); sub test_scalar { my $scalar_ref = $_[0]; $$scalar_ref = "whatever"; }