in reply to Re: Erm? Bug or not? Weird behaviour in hash / list conversion
in thread Erm? Bug or not? Weird behaviour in hash / list conversion

pp_aassign: tmpstr = NEWSV(29,0); if (*relem) sv_setsv(tmpstr,*relem); *(relem++) = tmpstr; didstore = hv_store_ent(hash,sv,tmpstr,0);
Create new SV, copy stack SV into new SV, set stack element to new SV, store new SV in hash.
hv_store_ent takes ownership of tmpstr; the second time key SV gets set, the first tempstr is dereffed while still on the stack.

I don't immediately see why *(relem++) has to be set to tmpstr.
Other interesting oneliners:
perl -le 'print join ".", %h = (1,2,1,3,1,4)' 1.4.1..1.4 perl -le 'print join ".", %h = (1,2,1,3,1,[])' 1.ARRAY(0x80fa8cc).1.ARRAY(0x80fa8cc).1.ARRAY(0x80fa8cc)