|
|
|
Your skill will accomplish what the force of many cannot |
|
| PerlMonks |
Re: How do I push new data into an existing hash?by juo (Curate) |
| on Apr 19, 2001 at 13:23 UTC ( [id://73780]=note: print w/replies, xml ) | Need Help?? |
|
I want to add something to an existing key of a hash.
$hash{key}=$val; will replace the content of key with a new content $val but will not add $val to the already existing content of key. If I try to use push to add the new value to the exisiting content then perl will give an error message : Type of arg 1 to push must be array (not hash elem.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||