in reply to Using config::any
Data::Dumper is useful for investigating unknown data structures.
Dummy ini file for testing:
$ cat > pm_config_any.ini some_key=qwerty password=Pa55w0rd other_key=zxcvbn
Code to see full $cfg structure and the specific item you want:
$ perl -Mstrict -Mwarnings -E ' use Config::Any; use Data::Dumper; my $pw_ini_file = q{./pm_config_any.ini}; my @files = ($pw_ini_file); my $cfg = Config::Any->load_files({files => \@files, use_ext => 1}); say q{Full $cfg structure:}; say Dumper $cfg; say q{Password: }, $cfg->[0]{$pw_ini_file}{password}; ' Full $cfg structure: $VAR1 = [ { './pm_config_any.ini' => { 'password' => 'Pa55w0rd', 'some_key' => 'qwerty', 'other_key' => 'zxcvbn' } } ]; Password: Pa55w0rd
-- Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using config::any
by ItsyBitsy (Novice) on May 31, 2012 at 03:02 UTC | |
by kcott (Archbishop) on May 31, 2012 at 10:23 UTC | |
by ItsyBitsy (Novice) on Jun 01, 2012 at 08:03 UTC |