我正在尝试从ID3标签中获取MP3文件的信息。Perl脚本的ID3信息问题
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]/;
然而,这将返回以下错误:
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.
可能有人建议对这个错误是什么意思?我需要安装什么软件包?
ohh,谢谢。我现在也在试用MP3 :: Tag。似乎有点更清洁:) – Dean 2011-04-17 03:51:57
_ [院长](http://stackoverflow.com/users/422687/dean)_:不客气。一个专门的模块是要走的路。 :-) – 2011-04-17 03:54:32