in reply to Using config::any
If you wanted to hard-code it, you could write:use strict; use warnings; use Config::Any; my @files = ("test.cfg.ini");# $files[0]="C:\\wamp\\www\\password.ini" +; my $cfg = Config::Any->load_files({files =>\@files,use_ext => 1 }); for my $c (@$cfg){ for my $f (keys %$c){ print "File $f has the following :\n"; for my $section(keys %{$c->{$f}}){ print " in Section $section:\n"; for my $k2 (keys %{$c->{$f}{$section}}){ print "\t$k2=" . $c->{$f}{$section}{$k2} . "\n"; } } } } }
print $cfg->[0]{'test.cfg.ini'}{password}{password} . "\n"; # prints +'mypass'
I hope life isn't a big joke, because I don't get it.
-SNL
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using config::any
by ItsyBitsy (Novice) on May 31, 2012 at 03:16 UTC | |
by NetWallah (Canon) on May 31, 2012 at 05:38 UTC | |
by ItsyBitsy (Novice) on Jun 01, 2012 at 08:01 UTC |