Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: how can i create a hash by reading an array

by davorg (Chancellor)
on Jul 22, 2005 at 10:05 UTC ( [id://477160]=note: print w/replies, xml ) Need Help??


in reply to how can i create a hash by reading an array

my %hash; while (<SOME_FILE>) { chomp; my ($k, $v) = split /\s+/, $_, 2; $hash{$k} = $v; }
--
<http://www.dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg

Log In?
Username:
Password:

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

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

    No recent polls found