in reply to hash refferences
my %h = (1, 2); print bless(\%h), $/; %h = undef; print bless(\%h), $/; __END__ main=HASH(0x99ae63c) main=HASH(0x99ae63c)
It's the same memory address after assigning undef.
The usual way to do it is to declare the hash inside the loop:
for $val (@variables) { my %temp; # work with %temp here; push @array, \%temp; }
That way a new variable is generated for each iteration.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: hash refferences
by leonidlm (Pilgrim) on Aug 21, 2008 at 12:36 UTC | |
by Corion (Patriarch) on Aug 21, 2008 at 12:40 UTC | |
by moritz (Cardinal) on Aug 21, 2008 at 12:53 UTC | |
by Anonymous Monk on Aug 22, 2008 at 06:44 UTC | |
|
Re^2: hash refferences
by leonidlm (Pilgrim) on Aug 21, 2008 at 12:55 UTC | |
by moritz (Cardinal) on Aug 21, 2008 at 12:58 UTC | |
by leonidlm (Pilgrim) on Aug 21, 2008 at 13:15 UTC | |
by moritz (Cardinal) on Aug 21, 2008 at 13:20 UTC | |
by Corion (Patriarch) on Aug 21, 2008 at 12:57 UTC |