use warnings; use strict; use Config::Perl; use Data::Dumper; my $parser = Config::Perl->new; my $data = $parser->parse_or_die('file.pl'); my %hash1 = %{ $data->{'%hash1'} }; print Dumper(\%hash1); __END__ $VAR1 = { 'hi' => 2, 'hello' => 1 };