Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Slurping BIG files into Hashes

by hardburn (Abbot)
on Jun 18, 2003 at 17:50 UTC ( #266928=note: print w/ replies, xml ) Need Help??


in reply to Slurping BIG files into Hashes

Slurp it into an array first, then move to a hash:

my %lookup = map { substr($_, 0, 13) => substr($_, 13) } <CONFIG>;

----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer

Note: All code is untested, unless otherwise stated


Comment on Re: Slurping BIG files into Hashes
Download Code
Re: Re: Slurping BIG files into Hashes
by Elgon (Curate) on Jun 18, 2003 at 18:10 UTC

    hardburn,

    Thanks - 15 minutes as opposed to 30.

    Elgon

    Please, if this node offends you, re-read it. Think for a bit. I am almost certainly not trying to offend you. Remember - Please never take anything I do or say seriously.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2015-07-05 05:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls