package Foo; use strict; my %config = _fill_config(); sub new { my $proto = shift(); my $status = shift() || 'normal'; my $package = ref($package) || $package; my $self = { status => $status }; bless($self, $package); return $self; } sub change_config { my $self = shift(); return unless $self->{status} ne 'admin'; %config = _fill_config(); } sub _fill_config { my %temp = _parse_file('config.cfg'); return %temp; }