I’m trying to get an MP3 file’s information from ID3 tags.
my $output_file = `ls | egrep '\.flac$|\.mp3$'`;
$output_file = "$output_folder\/$output_file";
my $artist = "id3info \"$output_file\" | grep '^=== TPE1' | sed -e 's/.*: //g'"
my $album = "id3info \"$output_file\" | grep '^=== TALB' | sed -e 's/.*: //g'";
my $format = "MP3";
my $bitrate = "id3info \"$output_file\" | grep 'Bitrate' | sed -e 's/.*: //g'";
my $genretags = "id3info \"$output_file\" | grep '=== TCON' | sed -e 's/.*: //g', mix, auto.up";
$genretags =~ tr/[A-Z]/[a-z]/;
However this returns the following error:
syntax error at mp3.pl line 88, near "my "
Global symbol "$album" requires explicit package name at mp3.pl line 88.
Global symbol "$album" requires explicit package name at mp3.pl line 173.
Could someone advise on what this error means? What package do I need to install?
Let me introduce you to MP3::Tag
This code above was copied (nearly) verbatim from the examples shown in
MP3::Tag‘s documentation.