in reply to Help with reading MP3's

Try adding a failure message to your 'open':

my $file = 'file.mp3'; my $mp3 = MP3::Tag->new($file) or die "Can't open $file: $!\n";

Although it doesn't seem to be documented, MP3::Tag->new seems to set $! on failure. Very likely you have a mismatch between to current directory and the directory you think is current when the script runs.

True laziness is hard work

Replies are listed 'Best First'.
Re^2: Help with reading MP3's
by StarkRavingCalm (Sexton) on Aug 25, 2011 at 11:25 UTC

    Same results.

    NOTE: If I just put in a filename.mp3 or *.mp3 (mp3's are in the same directory as script), I get "No file or directory."

    If I give it an absolute path, it hangs. Using strict gives the following: "Global symbol "@info" requires explicit package name at"

      Using strict gives the following: "Global symbol "@info" requires explicit package name at"

      Yep! Because that line should say:
      my @info=$mp3->autoinfo;

      Your script reads the filenames from the standard input (keyboard) I assume. Are you inputting the full paths or correct relative paths?

      Wildcards in your input will NOT be expanded, so don't try those.

      If under windows, you need to pay special to spaces and such in the filename. Better still, surround your inputs with quotes marks

        I would ultimately like to throw a directory at it and have it read, recursively, all MP3s contained therein.