in reply to Global objects and GC
When you say global, do you mean a lexical with package or file-level scope or do you mean a true global accessible through the symbol table?
If the former, as I suspect, then Perl's reference counting GC may be tripping you up. In that case, every subroutine that refers to a lexical in an outer scope is a closure and increases the refcount of the lexical. At shutdown time, when Perl GCs the subroutines themselves, that reference count decreases.
It sounds to me like you need a separate finalize() method to call explicitly, rather than waiting for DESTROY(). That way, you can avoid the rather messy and unspecified order of destruction errors I think you're having.
Perl's global destruction is a race for the exit. Who knows what order things will happen?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Global objects and GC
by TimToady (Parson) on Mar 04, 2004 at 21:40 UTC | |
|
Re: Re: Global objects and GC
by larsen (Parson) on Mar 05, 2004 at 11:38 UTC | |
by chromatic (Archbishop) on Mar 05, 2004 at 20:54 UTC | |
|
Re: Re: Global objects and GC
by Anonymous Monk on Mar 05, 2004 at 07:26 UTC |