jens has asked for the wisdom of the Perl Monks concerning the following question:
I'm doing a bit of data munging for a client and
I want to suck around 6,000 records from a flat file
into a large hash of hashes. I've RTFM'd and I'm still
struggling--your help would be much appreciated.
Here's what I have so far:
Please help!
--
Microsoft delendum est.
I want to suck around 6,000 records from a flat file
into a large hash of hashes. I've RTFM'd and I'm still
struggling--your help would be much appreciated.
Here's what I have so far:
I've also considered using an array of hashes, but that's also confused me.my %hash_of_hashes = ( my $record_no => my %unitfiles_hash ); #suck all the unit files into a big hash to make searching easier while (<UNITFILES>) { my @unitfiles_field = split /,/; #this is just an autogen number $record = $unitfiles_field[0]; %hash_of_hashes{$record_no} = ( %unitfiles_hash = ( lastname => $unitfiles_field[1], firstname => $unitfiles_field[2], DOB => $unitfiles_field[7], funding => $unitfiles_field[18], URNo => $unitfiles_field[15], Photo_permission => $unitfiles_field[14], ); ); } #end while
Please help!
--
Microsoft delendum est.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Hash of hashes syntax
by Enlil (Parson) on Mar 19, 2003 at 06:53 UTC | |
Re: Hash of hashes syntax
by jdporter (Paladin) on Mar 19, 2003 at 07:03 UTC | |
by bwana147 (Pilgrim) on Mar 19, 2003 at 08:41 UTC | |
by Enlil (Parson) on Mar 19, 2003 at 09:19 UTC | |
by Chmrr (Vicar) on Mar 19, 2003 at 09:24 UTC | |
Re: Hash of hashes syntax
by thor (Priest) on Mar 19, 2003 at 13:13 UTC | |
by sauoq (Abbot) on Mar 20, 2003 at 00:56 UTC | |
by thor (Priest) on Mar 20, 2003 at 06:00 UTC | |
by sauoq (Abbot) on Mar 20, 2003 at 10:12 UTC | |
|
Back to
Seekers of Perl Wisdom