> >> A simple solution is to rebless the object into another package
> > What did you mean by that?
> 
> bless $event, "foo";  foo doesn't have DESTROY, the event will not get
> killed. 

Now that I think about it there is a third solution.

1) bless $obj, 'Foo' immediately after fork 
 (object cannot be used in child)

2) eval 'END{bless $obj, "Foo"}';
 (object can be used in child, we may need to install many END{} 
 blocks. Will NOT work is you explicitly undef $obj !!!)

3) bless $obj, 'Obj::Class:_no_destroy'; 
        sub Obj::Class::_no_destroy::DESTROY{};
        @Obj::Class::_no_destroy::ISA = qw(Obj::Class);
 (Object may be used in child. No need for END{} block. Will work OK 
even if you explicitly undef $obj)

Actualy I like this last solution best since this allows you to 
change even other methods not only DESTROY.

Maybe Obj::Class::_not_owner would be better than 
Obj::Class:_no_destroy than.

Jenda

== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==
: What do people think?
What, do people think?  :-)
             -- Larry Wall in <[EMAIL PROTECTED]>

Reply via email to