in reply to Re^2: Unusual "Can't locate object method"
in thread Unusual "Can't locate object method"

Yes, and the title() method also works as expected in this context, which is why your output includes "title:Title Test".

Your error is coming from the following line, where it calls track()->toCString() because, as others have stated, track() returns a plain integer, not an object, and plain integers don't have object methods. Because they're not objects.

Change that line to say 'track', $file->tag()->track(); and it will do what you presumably want it to. (Namely, it will print "track0".)

Replies are listed 'Best First'.
Re^4: Unusual "Can't locate object method"
by geoffleach (Scribe) on Nov 01, 2024 at 19:55 UTC
    There are none so blind as those who will not ... read the code carefully.

    Thanks for helping me to see the obvious.