Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Mapping to an associative hash

by Thelonius (Priest)
on Sep 16, 2003 at 21:06 UTC ( [id://291965]=note: print w/replies, xml ) Need Help??


in reply to Mapping to an associative hash

Sure thing! If you have the keys you want in an array @keys (in the order that the data appears in the file), then all you need to say is:
while (<FILE>) { my %data; chomp; @data{@keys} = split /\t/; # then call subroutine }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (6)
As of 2024-04-23 06:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found