Um, all instances of perl under Unix are instantiated using exec(). DESTROY doesn't get called if you script goes away because of a successful exec. How perl was started doesn't matter.
Now, if the script isn't being run by perl (the separate executable) but is instead being run by a Perl interpretter embedded in some other executable, then your object might not be destroyed until the interpretter is torn down, and that might not happen until much later in such cases. mod_perl is just one example of this. You can usually check $^X to if you have such a case.
If you avoid putting references to your object into global variables (also known as package variables), then your DESTROY method won't have to wait until the interpretter is destroyed. But inheritting from CGI would probably break that since CGI stores a reference to its first instantiation into a global variable in case you use the "function" interface (vs. of the OO interface).
- tye (but my friends call me "Tye")In reply to (tye)Re: $obj-DESTROY isn't called upon
by tye
in thread $obj-DESTROY isn't called upon
by Sinister
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |