develooper Front page | perl.perl5.porters | Postings from September 2000

XS self-tied AV goes into recursive frenzy on FETCH

Thread Next
Alan Burlison
September 27, 2000 15:18
XS self-tied AV goes into recursive frenzy on FETCH
Message ID:
I've some XS code that creates a self-tied AV thusly:

        av = newAV();
        rv = newRV_noinc((SV *)av);
        sv_bless(rv, gv_stashpv("MyPackage", TRUE));
        sv_magic((SV *)av, Nullsv, 'P', Nullch, 0);
	RETVAL = rv;

I basically copied the logic from pp_tie.  However, when the FETCH
method (written in perl) is called, it goes into a recursive frenzy
repeatedly calling itself on the AV.  This kind of makes sense - after
all because it is a self-tie the tied from and tied to AVs are one and
the same.  However this recursion doesn't happen if you do a self-tie
purely in perl, so I must be missing a necessary step somewhere.  Can
someone give me a clue?


Alan Burlison

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About