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

XS self-tied AV goes into recursive frenzy on FETCH

Thread Next
From:
Alan Burlison
Date:
September 27, 2000 15:18
Subject:
XS self-tied AV goes into recursive frenzy on FETCH
Message ID:
39D27205.3222F278@uk.sun.com
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?

Thanks,

Alan Burlison

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About