Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Perl hashes: is there some way of adding more data to the value associated with an existing key?

by choroba (Cardinal)
on Jun 07, 2011 at 14:53 UTC ( [id://908492]=note: print w/replies, xml ) Need Help??


in reply to Perl hashes: is there some way of adding more data to the value associated with an existing key?

Use hash of arrays, see perldsc. Example:
my %h = ( 1 => ['A', 'B'], 2 => ['B'], 4 => ['X'], 5 => ['V'], ); print join(' ', @{ $h{1} }),"\n";
  • Comment on Re: Perl hashes: is there some way of adding more data to the value associated with an existing key?
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://908492]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-19 21:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found