Hi,
I'm writing a simple mp3 cataloging program in perl and I am having some problem creating a hohoa. I have a list of mp3 which I want to store the mp3 tags
foreach my $mp3_file (@cdrom_mp3s) {
chomp $mp3_file;
my $mp3 = MP3::Tag->new($mp3_file);
$mp3->getTags;
if (exists $mp3->{ID3v1}) {
my $id3v1 = $mp3->{ID3v1};
#print STDOUT $id3v1->artist," : ", $id3v1->song,"\n";
my $track_song = $id3v1->track."-".$id3v1->song;
$artist_mp3{$id3v1->artist}{$id3v1->album}++;
}
}
As it is I end up with the number of tracks in each album (
artist_mp3{$id3v1->artist}{$id3v1->album})
However how do I modify this so that the above variable contains an array of all the songs eg
push (@$artist_mp3{$id3v1->artist}{$id3v1->album}, id3v1->song);
except a working version ;-)
Diarmuid
Edit by tye
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.