in reply to Hashes hunt me even when I sleep....
This will populate a hash:
And this will retrieve the data back, unsorted:# warning: untested my %collection; while(<ALBUMS>) { my ($artist, $album, $song) = split; push @{$collection{$artist}{$album}}, $song; }
Hope this helps, Jeffforeach my $artist (keys %collection) { print "$artist:\n"; foreach my $album (keys %{$collection{$artist}}) { print "\t$album:\n\t\t"; print join("\n\t\t", @{$collection{$artist}{$album}}), "\n"; } }
UPDATE: oops, yes isotope - that's what I meant.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: Hashes hunt me even when I sleep....
by isotope (Deacon) on Oct 06, 2000 at 00:58 UTC |