davemabe has asked for the wisdom of the Perl Monks concerning the following question:
open (FILE,$file); # $file is a |-delimited file my @header = ('h1','h2','h3'); # I already know the headings my %values; # make a hash of hashes to remember the values while (<FILE>) { chomp; my @columns = split /\|/; my $unique = $columns[1]; # h2 is the unique identifier @values{$unique}{@header} = @values; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Slice of a hash of hashes
by chipmunk (Parson) on Jan 08, 2001 at 21:41 UTC | |
|
Re: Slice of a hash of hashes
by davorg (Chancellor) on Jan 08, 2001 at 21:46 UTC |