No such thing as a small change | |
PerlMonks |
Re: Extending Arrayby moritz (Cardinal) |
on Mar 21, 2012 at 14:57 UTC ( [id://960783]=note: print w/replies, xml ) | Need Help?? |
$thing is a hash reference, not an array. See perldata and perlreftut for some more information. Two ways to extend it:
The first one generates a new hash and a new reference to it, the second adds items to the existing hash. Which one you should use depends on your use case (and is only relevant if there are other references to the same hash somewhere).
In Section
Seekers of Perl Wisdom
|
|