Another approach is to just use one of the configuration modules, like perhaps Config::Tiny. This avoids the "execute user editable code" problems of eval and folks are familiar with the format. Its just 2 lines of code for the basics..
#!/usr/bin/perl -w
use strict;
use Config::Tiny;
use Data::Dumper;
my $Config = Config::Tiny->read( 'configfile.txt') or die " $!";
# $Months here is a ref to a hash
#
my $Months = $Config->{Months};
print Dumper \$Months;
=prints
$VAR1 = \{
'Month1' => 'January',
'Month2' => 'February'
};
=cut
__END__
#file configfile.txt contains this comment and this data
#Sample Configuration File
[Months]
Month1 = January
Month2 = February
[Another_Section]