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)