Sure. The keys of the hash are strings, the values are scalars. And the values of the scalars are copied, even if the value is just a reference. It's the same as this:
my $x = 999; my $r1 = \$x; my $r2 = $r1; print "\$r1=$r1\t\$r2=$r2\t\$\$r1=$$r1\t\$\$r2=$$r2\n"; $x = 111; print "\$r1=$r1\t\$r2=$r2\t\$\$r1=$$r1\t\$\$r2=$$r2\n"; ${$r1} = 555; print "\$r1=$r1\t\$r2=$r2\t\$\$r1=$$r1\t\$\$r2=$$r2\n"; ${$r1} = 777; print "\$r1=$r1\t\$r2=$r2\t\$\$r1=$$r1\t\$\$r2=$$r2\n";
In reply to Re^5: Massive Perl Memory Leak
by Jenda
in thread Massive Perl Memory Leak
by wagnerc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |