in reply to Weird perl behavior regarding unloading class modules
Odd indeed, that DESTOY would be called after END. These problems can usually be solved by explicitly undefing your instance object.use strict; use warnings; package Foo; our $Obj = Foo->new(); sub new { bless {}, shift; } sub DESTROY { my $this = shift; print "DESTROYING $this\n"; } sub END { print "Ending! (global = $Obj)\n"; } ## OUTPUTS Ending! (global = Foo=HASH(0x1a7f0c8)) DESTROYING Foo=HASH(0x1a7f0c8)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re2: Weird perl behavior regarding unloading class modules
by tye (Sage) on Jan 20, 2001 at 10:09 UTC | |
by MeowChow (Vicar) on Jan 21, 2001 at 01:11 UTC |