Menu

#6 Can't call method "substring" in MP3::Tag::ID3v2

open
nobody
None
5
2004-08-23
2004-08-23
Tim Hunter
No

Hi. I tripped across the following error when
surveying all my various & sundry mp3 files:

Can't call method "substring" without a package or
object reference at
/usr/lib/perl5/site_perl/5.8.5/MP3/Tag/ID3v2.pm line 303.

I'm using the latest MP3::Tag from CPAN, 0.92.
ID3v2.pm contains $VERSION="0.91"; (Confusingly,
ID3v2.pm in the CVS repository here has $VERSION="0.80").

The relevant code snippet:

if ($frame->{flags}->{groupid}) {
$frame->{gid} = substring $result, 0, 1;
$result = substring $result, 1;
}

Did you mean to use plain old 'substr' here?

Data::Dumper output of $result & $frame for the
offending (and probably broken by MP3ext[1]) mp3, just
before that routine:

$result = '3.16(unicode) MP3ext V3.3.16(unicode) MP3ext
V3.3.16(unicode) MP3ext V3.3.16(unicode) MP3ext
V3.3.16(unicode) MP3ext V';
$frame = {
'flags' => {
'unchanged' => 1,
'encryption' => '0',
'compression' => '0',
'0' => '1',
'read_only' => '1',
'groupid' => '1',
'tag_preserv' => '0',
'file_preserv' => '0'
},
'data' => '3.16(unicode) MP3ext
V3.3.16(unicode) MP3ext V3.3.16(unicode) MP3ext
V3.3.16(unicode) MP3ext V3.3.16(unicode) MP3ext V',
'major' => 3
};

[1] http://www.mutschler.de/mp3ext/

Discussion


Log in to post a comment.