package My::Twitter::AllAccounts; use strict ; use warnings ; ... blah blah blah sub new { my $class = shift; my %parameter_hash; $parameter_hash{ DEBUG } = 0 unless( $parameter_hash{ DEBUG } ); my @twitter_accounts ; my $self = { TWITTER_ACCOUNTS => \@twitter_accounts , DEBUG => $parameter_hash{ DEBUG } , } bless( $self, $class ); dump( $self ) if( $self->{DEBUG} == 1 ); return $self; } sub add_twitter_account { my $self = shift ; my $name = shift ; my ( $file, $headings ) = _function_that_gets_files_and_headings(); # This can also be inside the Twitter::Account class. my $twitter_account = new My::Twitter::Account( NAME => $name , FILE => $file , HEADINGS => $headings , ); push( @{ $self->{ TWITTER_ACCOUNTS } }, $twitter_account ) ; return 1; }