use strict; use warnings; use Data::Dump qw(dump ddx); use Config::General; my $conf = Config::General->new(-ConfigFile => "sample.conf"); my %prev_config = $conf->getall; print dump(\%prev_config);