in reply to Re^2: map to hash of arrays
in thread map to hash of arrays
my %hash; my $key; while (<>) { /\S+ : (\S+)/ or die "unexpected line format: $_"; my $value = $1; if (defined $key) { push @{ $hash{$key} }, $value; undef $key; else { $key = $value; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: map to hash of arrays
by emilford (Friar) on Jul 27, 2004 at 13:53 UTC | |
by dpuu (Chaplain) on Jul 27, 2004 at 16:26 UTC | |
by emilford (Friar) on Jul 27, 2004 at 21:42 UTC |