Perl コードで Config::scoped モジュールを使用したいと考えています。
これは私の設定です:
http_db{
user = 'xxx';
pass = 'aaa';
dbname = 'data';
host = 'dataserver.company.cz';
}
私が使用する場合:
my $cs = Config::Scoped->new( file => $config);
my $cfg_hash = $cs->parse;
.
.
.
print $cfg_hash->{http_db}{user}; # prints xxx;
if ( defined( $cfg_hash->{http_dp}{user} ) ) {
print "defined"; # does not print
else{
print "undefined"; # prints
}
if 条件が満たされることを期待していますが、そうではありません。なんで?