package ConfigFile; my $self; sub new { if ( ! defined $self ) { my $that=shift; my $class=ref($that) || $that; $self = { Verbose => 1, RaiseErrors => 0}; bless $self, $class; } return $self; } sub get_conf { my $self=shift; my $param=shift; my $result; # get result return $result; } 1; #### package TestClass; require ConfigFile; sub new { my $that=shift; my $class=ref($that) || $that; my $self={ Verbose => 1, RaiseErrors => 0, Config => ConfigFile->new() }; bless $self, $class; return $self; } sub anything { my $self=shift; # Access config via $self->{Config}->get_conf() return; } 1;