in reply to How do you delete an unwanted object?
The output is:#!/usr/bin/perl -w use strict; my $foo = new stuff; my $bar = new stuff; print $foo,"\n"; $foo = undef; print STDERR "foo gone\n"; exit; package stuff; sub new { my $self = []; bless $self; return $self; } sub DESTROY { my ($self) = @_; print STDERR "destroying...\n"; } 1;
stuff=ARRAY(0x80cb9c8) destroying... foo gone destroying...As you can see:
|
|---|