in reply to Arrary of Hashes populating issue
Since some of the variables that you're taking references to within the loops were declared outside the loops, they never fall out of scope from iteration to iteration. Hense, for those variables, you're dealing with the same memory location, same variable each time you take a reference to it while constructing your datastructure.
You should either redesign your lexical scoping so that you get a new variable on each iteration, or (easier) you should change all \@varname to [ @varname ], and all \%varname to { %varname }.
The anonymous array constructor, and the anonymous hash constructor will create entirely new anon arrays / anon hashes, instead of reusing the same ones. You might have a look at perlreftut and perlref for info on these constructors.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Arrary of Hashes populating issue
by SmokeyB (Scribe) on Jan 27, 2005 at 17:20 UTC |