Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: multiple values for one key in hash

by Anonymous Monk
on Feb 25, 2015 at 17:29 UTC ( [id://1117848]=note: print w/replies, xml ) Need Help??


in reply to multiple values for one key in hash

I was just asking myself this same question. While I'm sure most of the comments below work just fine, I'd like to add my solution as well.

I just separated the "values" by a comma, and have a single "value" related to the key in my hash.

When I read out the key value, I'll just do a split on the value in order to break it up in to the individual data points I need.

This is simple, and very readable/easy to understand for someone who is not quite a perl monk like me.
  • Comment on Re: multiple values for one key in hash

Replies are listed 'Best First'.
Re^2: multiple values for one key in hash
by Hermano23 (Beadle) on May 29, 2015 at 20:17 UTC
    Seems valid to me, at least as long as you're looking at a small number of vals, but as always TMTOWTDI.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2024-04-26 00:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found