#!/usr/bin/perl use strict; use warnings FATAL => qw(all); my $t = test->new(); print "The End.\n"; { package test; sub new { my $class = shift; my $self = { list => [ 'a', 'b', 'c' ] }; bless $self, $class; } sub DESTROY { my $self = shift; print STDERR "Bye!".$self->{list}->{4}."\n"; } 1; }