In order to fix the duplicate DESTROY bug, I need to remove [the
modified] lines from sv_setsv.
Basically, copying an object shouldn't produce another object without an
explicit blessing. I'm not sure if this will break anything. If Ilya
and anyone else so inclined would apply this patch and see if it breaks
anything related to overloading (or anything else object-oriented), I'd
be much obliged.
By the way, here's a test script for the duplicate DESTROY. You'll note
that it prints DESTROYED twice, once for , and once for . I don't
think an object should be considered an object unless viewed through
a reference. When accessed directly it should behave as a builtin type.
#!./perl
= new main;
= '';
sub new {
my ;
local /tmp/ssh-vaEzm16429/agent.16429 = bless $a;
local = ; # Bogusly makes an object.
/tmp/ssh-vaEzm16429/agent.16429;
}
sub DESTROY {
print "DESTROYED\n";
}
Larry
else {
(void)SvOK_off(dstr);
}
- if (SvOBJECT(sstr)) {
- SvOBJECT_on(dstr);
- SvSTASH(dstr) = (HV*)SvREFCNT_inc(SvSTASH(sstr));
- }
SvTAINT(dstr);
}