The reference still points to the same place as %temporary, so changing one will also change the other. I suggest the following code:
foreach my $val (@variables) { my %temporary = ...; push @arrayOfHashes, \%temporary; };
%temporary is not a reference and hence you can't "lose" the reference to its data.
In reply to Re: hash refferences
by Corion
in thread hash refferences
by leonidlm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |