use Config::Perl; my $parser = Config::Perl->new; my $conf = $parser->parse_or_die('foo.conf'); use Data::Dumper; print Dumper($conf);