Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Converting a Flat-File to a Hash

by mickeyn (Priest)
on Aug 14, 2006 at 06:18 UTC ( #567159=note: print w/ replies, xml ) Need Help??


in reply to Converting a Flat-File to a Hash

no Tie suggestions ? :-)

ok, here's one:

#!/usr/bin/perl use strict; use warnings; use Tie::File; tie my @array, 'Tie::File', "/the/file/in/question" or die "can't tie +file"; my %data = map { split /:/; $_[0] => $_[1] } @array;
Enjoy,
Mickey


Comment on Re: Converting a Flat-File to a Hash
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2015-07-05 23:50 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 (68 votes), past polls