in reply to Re^2: Redefine DESTROY in class instance
in thread Redefine DESTROY in class instance

Does it work if you don't make it a singleton object?

-xdg

Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

  • Comment on Re^3: Redefine DESTROY in class instance

Replies are listed 'Best First'.
Re^4: Redefine DESTROY in class instance
by tmaly (Monk) on Sep 04, 2007 at 15:04 UTC
    Due to the nature of the usage of this class, I needed it to be a singleton. I did test it without the singleton and it did not seem to work. I was able to see that the IO::Handle::DESTROY was being called multiple times when I changed the symbol table to redefine it. I was able to come up with a work around solution. I subclassed IO::File and defined a DESTROY in this subclass that wrote out to the log file, called SUPER::DESTROY then closed the filehandle. This worked like a charm. I want to say thank you for your help on this. Best Regards Ty