$ perl -e 'my $z; my $x = sub { $z; "test" }; bless $x, "HRM"; sub HRM::DESTROY { print "bye\n" };' bye $