leonidlm has asked for the wisdom of the Perl Monks concerning the following question:
My question is why after I assign a reference to an object and then I loose the original reference to it (by assigning another value -> undef) The original hash in the array is changed too!my @arrayOfHashes; my %temporary; foreach $val (@variables) { # Here I populate a temporary hash # # .... # push @arrayOfHashes, \%temporary; %temporary = undef; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: hash refferences
by Corion (Patriarch) on Aug 21, 2008 at 12:20 UTC | |
|
Re: hash references
by moritz (Cardinal) on Aug 21, 2008 at 12:21 UTC | |
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 | |
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 |