Syntactic Confectionery Delight | |
PerlMonks |
Re: Perl hashes: is there some way of adding more data to the value associated with an existing key?by Eliya (Vicar) |
on Jun 07, 2011 at 14:53 UTC ( [id://908491]=note: print w/replies, xml ) | Need Help?? |
The value of a hash entry is a scalar, but this scalar can be a reference to an array, into which you can put more than one value:
Also, Perl features autovivification, so you don't need to worry about the initial case when there is no array(ref) yet — i.e. Perl implicitly creates it for you.
In Section
Seekers of Perl Wisdom
|
|