sub DESTROY { my $this = shift; my @err = $this->error; while (@err) { my $msg = shift @err; carp "$this destroyed with error: '$msg'" .(@err ? ' (and '.scalar @err.' more).' : '.'); } } #### $test = bless( { '_ERR_' => [ 'First error', 'Hello there!' ] }, 'LocalTest2' ); LocalTest2=HASH(0x18633a4) destroyed with error: 'First error' (and 1 more). at test.pl line 0 LocalTest2=HASH(0x18633a4) destroyed with error: 'Hello there!'. at test.pl line 0