package MyObject; my @a = (); sub new { my $class = shift; my $self = {}; bless $self, $class; return $self; } sub A { my $self = shift; return \@a; } sub fillIt { my $self = shift; my %hash = (); my $i = 0; for($i=0; $i<10; $i++) { $hash{"key_$i"} = $i; } push(@a, \%hash); } sub cleanUp { my $self = shift; #?????????????????????????????????????????????????? # best way to deref entire @a? #?????????????????????????????????????????????????? } return 1;