#!/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;