in reply to Testing DESTROY Methods?
And your test script would then do:package Camel; use strict; # Warning, do not use this constructor at home kids. # It's ugly and will scare the neighbours. sub new { bless {}; } sub DESTROY { print "My camel has sadly passed away.\n"; }
use strict; use Camel; { my $jimmy=Camel->new(); } #$jimmy is now out of scope and will be DESTROYed.
CU
Robartes-
|
|---|