Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Loading a textfile into a hash

by kabel (Chaplain)
on Nov 14, 2002 at 10:23 UTC ( #212804=note: print w/ replies, xml ) Need Help??


in reply to Loading a textfile into a hash

use strict; use warnings; use Data::Dumper; my %hash = map {chomp; split /: */} <DATA>; print Dumper \%hash; __DATA__ natural number: a non-negative integer counting number: a positive integer rational number: a real that can be expressed as a fraction
UPDATE: included chomp


Comment on Re: Loading a textfile into a hash
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (14)
As of 2015-03-30 17:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When putting a smiley right before a closing parenthesis, do you:









    Results (652 votes), past polls