in reply to Re^2: Question about MP3::Tag and undef id3v2
in thread Question about MP3::Tag and undef id3v2

G'day DecMoon,

Welcome to the Monastery.

These are lines 25 and 26 in the code you posted:

print Dumper(\$id3v2); print Dumper(\$id3v2->get_frame_ids);

The first line of output you show ($VAR1 = \undef;) is telling you that $id3v2 is undef (i.e. it's undefined).

So, "$id3v2->get_frame_ids" (in line 26) is equivalent to "undef->get_frame_ids". That's effectively what the second line of output you show is telling you.

You'll need to do something with your assignment to $id3v2. I'm unfamiliar with the MP3::Tag module, so I'm not really in a position to advise you what that "something" might be. Options could include: checking for definedness; setting a default value; skipping some part of the code if it's not defined; or something completely different.

— Ken