in reply to help with references
Both times that the loop is run, \@a returns a reference to the same array, because it is the same array that's on the right of the \ character.
To avoid that, you can use $h{$i} = [@a] instead, which copies the array and returns a reference to the copy.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: help with references
by dw_perlmonks (Novice) on May 04, 2013 at 19:42 UTC | |
by moritz (Cardinal) on May 04, 2013 at 20:11 UTC |