Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Parsing data into an Array of Hashes

by thinker (Parson)
on Sep 18, 2003 at 13:06 UTC ( #292377=note: print w/ replies, xml ) Need Help??


in reply to Parsing data into an Array of Hashes

Hi nimdokk

You could try something like

#!/usr/bin/perl use strict; use warnings FATAL => 'all'; use Data::Dumper; open DATA, "filename" or die $!; my @AoH; for (<DATA>){ my %hash; %hash = map { split '=' } split ','; push @AoH, \%hash; } print Dumper \@AoH;

cheers

thinker


Comment on Re: Parsing data into an Array of Hashes
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2014-07-26 13:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (177 votes), past polls