use MP3::Info; ... sub getInfo { # entry is a single line from the .m3u # which is the path up to and including the # song file. my ($entry) = shift; if ($entry =~ /\.ogg$/i) { my $ogg = Ogg::Vorbis->new; open(IN, "< $entry"); $ogg->open(IN); my $oggInfo = $ogg->info; my %tag = %{$ogg->comment}; close(IN); foreach my $key (keys %tag) { if ($key =~ /^artist/) { $info{artist} = $tag{$key}; } elsif ($key =~ /^album/) { $info{album} = $tag{$key}; } elsif ($key =~ /^title/) { $info{song} = $tag{$key}; } elsif ($key =~ /^genre/) { $info{type} = $tag{$key}; } elsif ($key =~ /^date/) { $info{year} = $tag{$key}; } } } elsif ($entry =~ /\.mp3$/i) { my $mp3hashref = get_mp3tag ($entry); my %mp3tag = %$mp3hashref if ($mp3hashref); $info{artist} = $mp3tag{ARTIST}; $info{album} = $mp3tag{ALBUM}; $info{song} = $mp3tag{TITLE}; $info{type} = $mp3tag{GENRE}; $info{year} = $mp3tag{YEAR}; } } #### Tk::Error: Tk::Listbox=HASH(0x8646f6c) is not a Tk object at /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Tk.pm line 91. (command bound to event) #### my %mp3tag = %$mp3hashref if ($mp3hashref);