Hello monks,

I am trying to find a script to read .mp3s and their tags. I have no need to write or re-write tags.

My first step is to have script read mp3's but for some reason, I cannot get one to work from any that I have found. I have included an example from your site.

Script hangs with no output or, if using strict, throws error of:

"Global symbol "@info" requires explicit package name at"

NOTE: Features I would like to have are:

List all mp3 files and their tags as well as any without tags (this should say something like "no tag found" or something)

List files missing certain tag elements (i.e. photo)

Here's the code:

Thanks!

#!/usr/bin/perl -w use MP3::Tag; # define how autoinfo tries to get information # default: # MP3::Tag->config("autoinfo","ID3v2","ID3v1","filename"); # don't use ID3v2: # MP3::Tag->config("autoinfo","ID3v1","filename"); while (<STDIN>) { chomp; if (my $mp3=MP3::Tag->new($_)) { print "$_ (Tags: ", join(", ",$mp3->get_tags),")\n"; @info=$mp3->autoinfo; print "* Song: $info[0]\n"; print "* Track: $info[1]\n"; print "* Artist: $info[2]\n"; print "* Album: $info[3]\n"; print "* Comment: $info[4]\n"; } }

In reply to Help with reading MP3's by StarkRavingCalm

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.