package A; sub DESTROY { print "destroy\n"; } sub new { bless {}, A } package main; my ($a, $o) = ( 1 ); if ( $a ) { my $a = A->new; print "scope left\n"; }