package My::Config; use strict; use base ( 'Class::Accessor' ); use Config::Auto; my $base = __PACKAGE__; our $config_hash = {}; bless $config_hash , $base; my $config = Config::Auto::parse( '/home/trs80/my.conf', format => 'equal' ); $base->mk_accessors(keys %{$config}); foreach (keys %{$config}) { $config_hash->$_($config->{$_}); } sub new { return $config_hash; } 1;