bman has asked for the wisdom of the Perl Monks concerning the following question:
So far, I have come up with this script:
while ($line = <ALBUMS>) {
($myArtist, $myAlbum, $mySong, $myLocation) = split('\|', $line);
$mySongs{$myLocation} .= $mySong . "+";
}
foreach $myLocation (sort keys %mySongs) {
++$i;
@mySongs = split('\+', $mySongs{$myLocation});
foreach $mySong (@mySongs) {
print "$mySong\n";
}
}
That onlyl gives me a list of songs and in this case, I would not have to even use hash (let's call it a mental excersise). What I want to do is this:
Artist:
Album:
Songs:
1.
2.
Album2:
Songs:
1.
2.
Artis2:
and so on. In essence I want a grouped report. How can I "attact" this issue (a sample code would be greatly appreciated)?
Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hashes hunt me even when I sleep....
by le (Friar) on Oct 05, 2000 at 23:55 UTC | |
|
Re: Hashes hunt me even when I sleep....
by rlk (Pilgrim) on Oct 06, 2000 at 02:14 UTC | |
|
(jeffa) Re: Hashes hunt me even when I sleep....
by jeffa (Bishop) on Oct 05, 2000 at 23:48 UTC | |
by isotope (Deacon) on Oct 06, 2000 at 00:58 UTC | |
|
Re: Hashes hunt me even when I sleep....
by kilinrax (Deacon) on Oct 05, 2000 at 23:52 UTC | |
|
RE: Hashes hunt me even when I sleep....
by bman (Sexton) on Oct 06, 2000 at 07:26 UTC | |
by the_slycer (Chaplain) on Oct 06, 2000 at 08:38 UTC | |
|
Re: Hashes hunt me even when I sleep....
by bman (Sexton) on Oct 07, 2000 at 06:31 UTC |