in reply to Re: sv_derived_from gives a confsing result
in thread sv_derived_from gives a confsing result

Thanks, Rob. Your code, plus this:
warn("not an object %s\n",(char *)SvPV_nolen(ST(0)));
Revealed that ST(0) was '1', leading to the discovery that despite coding that looked like C++, Perl was not treating it as such. Seems to be related to the fact that there was no new() method.

Sigh!

Replies are listed 'Best First'.
Re^3: sv_derived_from gives a confsing result
by ikegami (Patriarch) on Mar 29, 2011 at 08:52 UTC
    Audio::TagLib::ID3v2::Frame::size(1) would be just as wrong in C++. The C++ equivalent of the correct code would be «frame->size()».
Re^3: sv_derived_from gives a confsing result
by syphilis (Archbishop) on Mar 29, 2011 at 10:43 UTC
    Seems to be related to the fact that there was no new() method

    Sounds feasible. The method doesn't need to be called "new" (with C, at least), but if sv_isobject(sv) is to return true, then the reference (sv) does need to have been blessed into some package ... which is what "new" normally does, of course.

    Cheers,
    Rob