Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Need to get hash of arrays -- plain english

by Discipulus (Canon)
on May 14, 2021 at 06:12 UTC ( [id://11132564]=note: print w/replies, xml ) Need Help??


in reply to Need to get hash of arrays

Hello chandantul,

Firstly read perldsc then you can try this approach:

while reading the file, chomp the line, split the line using '| ' havi +ng back col1 and col2 then push into the hash key col1 the value of c +ol2. Hint: being values of the hash all arrayrefs you need some deref +encing like in @{ $hash{ $col1 } } doing the push.

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Log In?
Username:
Password:

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

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

    No recent polls found