Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^3: can i concatenate various value to form a unique key

by citromatik (Curate)
on Jul 03, 2009 at 10:34 UTC ( #777021=note: print w/ replies, xml ) Need Help??


in reply to Re^2: can i concatenate various value to form a unique key
in thread can i concatenate various value to form a unique key

Maybe I am wrong, but contrary to the others who have replied already, I think you are misinterpreting your problem (sorry if I misinterpreted you! :).

Do you want the following:

%hash = ( g1 => [value1, value2, value3], g2 => [value4, value5, value6...] );

i.e. do you want each key to have multiple values associated? If this is the case you need a reference to an array containing all the values (see perlref). You already have that situation in the example you give: g1 => [$start_date1,$end_date1], so, to concatenate more values, you will need a reference to an AoA (array of arrays). Again, sorry if I totally misinterpreted your problem, but if you think I am close, let me know and we will elaborate it a little more

citromatik


Comment on Re^3: can i concatenate various value to form a unique key
Select or Download Code
Re^4: can i concatenate various value to form a unique key
by Anonymous Monk on Jul 03, 2009 at 10:42 UTC
    i think i am bad in explaining :( my actaul issue with mutiple keys not values.. value i am laready refering to array. But to get that hash value array i need a key which is combination of various values. so i am stucked ....

      Like Marshall says, I think you want another data structure/strategy, you may get more helpful comments if you explain how did you run into this and give a wider view of your problem.

      citromatik

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2014-07-29 09:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (213 votes), past polls