Welcome to the Monastery | |
PerlMonks |
help with referencesby dw_perlmonks (Novice) |
on May 04, 2013 at 19:07 UTC ( [id://1032071]=perlquestion: print w/replies, xml ) | Need Help?? |
dw_perlmonks has asked for the wisdom of the Perl Monks concerning the following question:
Hi there esteemed Monks, I have a very noob-ish question here regarding refs, though still confounding to me at the very least... In the code example below, i'm trying to create a hash of arrays:
The Dumper output is
The question here is: why is $h{'2'} a reference to $h{'1'}? I'm trying to create a hash %h with identical key-values made of the @a array-of-arrays. I want each key-value of the hash to have it's own AoA based on @a, but i'm getting references to $h{'1'} instead. What am i doing wrong?? The Dumper output i'm trying to achieve is: Any help appreciated. thanks in advance! -dan
Back to
Seekers of Perl Wisdom
|
|