in reply to Re: Help needed for XS on Perl v5.8.3
in thread Help needed for XS on Perl v5.8.3

Thanks for reply.
But this approach does not solve my problem. On further investigation I have found out a clue that why this is behaving like this with Perl v5.8.3, but can not find the solution.
I have already metioned I have xs file, a.xs where the xs code is present. I have also a .map file say c.map file in c.map file I have written following code (the code has been taken from Advanced Perl Programming book)
TYPEMAP const char * T_PV test_class * ANY OBJECT OUTPUT ANY OBJECT sv_setref_pv($arg, CLASS, (void *) $var); INPUT ANY OBJECT $var = ($type) SvIV((SV*)SvRV($arg));
Now when Perl v5.6.1 generates .c file from .xs file following code was generated
XS(XS_Test_TestMethod) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Test::TestMethod(CLASS, param1)"); { char* CLASS = (char *)SvPV(ST(0),PL_na); pstruct * param1;
On the other hand Perl v5.8.3 generated following code
XS(XS_Test_TestMethod) { dXSARGS; if (items != 2) Perl_croak(aTHX_ "Usage: Test::TestMethod(CLASS, param1)"); { char* CLASS = (char *)SvPV_nolen(ST(0)); pstruct * param1 = (pstruct *) SvIV((SV*)SvRV(ST(1)));
Can anybody please tell me why code generation is different for Perl v5.6.1 and Perl v5.8.3? I also doubt that code generated by Perl v5.8.3 may cause problem in my script when no valid reference address passed to the TestMethod. Can anybody kindly give me any pointers to overcome this problem?
Thanks in advance.
Regards
-Pijush