package My::Module; sub new { my $class = shift; my $self = {}; # no clutter! bless $self, $class; } sub some_method { my $self = shift; # we use it here my $result = $self->_csv->some_csv_action( @input ); # uses accessor } sub _csv { my $self = shift; # allow to be set from outside if(@_) { $self->{_csv} = shift; } # default to Text::CSV if( !defined $self->{_csv} ) { require Text::CSV; $self->{_csv} = Text::CSV->new( 'some args' ); } return $self->{_csv}; }