Package MyAppConfig; my $cfg = { DBMpath => '/foo/bar/quux', salt => 'NaCl', baseDir => '/baz/bar/foo', }; sub salt { my ($class,$salt) = @_; $cfg->{salt} = $salt if $salt; return $cfg->{salt}; } # Write accessors/mutators as desired for the other elements too.