Saturday, 31 August 2013

Perl Config:Simple error

Perl Config:Simple error

tried to use Perl Config:Simple to load a properties file, one version
works, but another doesn't.
error message is : Use of uninitialized value in print
Do you know why ?
#doesn't work
my %Config;
Config::Simple->import_from('properties.txt', \%Config);
print $Config{"array_cache_size"};
#work
my $cfg = new Config::Simple('properties.txt');
my $array_cache_size = $cfg->param('array_cache_size');
print "$array_cache_size\n";

No comments:

Post a Comment