Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Consolidating data from lots of different sources

by Zaxo (Archbishop)
on Jun 08, 2005 at 21:57 UTC ( #464859=note: print w/replies, xml ) Need Help??


in reply to Consolidating data from lots of different sources

A hash of hashes will do that nicely,

my %hoh; my @labels = qw/SAN_Info Criticality_rating Commission_Date/; while (<>) { my ($key, @dat) = split ','; $hoh{$key}{$labels[$_] ||= $dat[$_] for 0..$#labels; }
The ||= assignment prevents a filled slot from being overwritten by undef.

After Compline,
Zaxo

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://464859]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2018-06-18 22:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (111 votes). Check out past polls.

    Notices?