http://www.perlmonks.org?node_id=770601


in reply to Re^4: conf file in Perl syntax
in thread conf file in Perl syntax

you should have better experimented with yourself!. :)
use Config::Inifiles; use Data::Dumper; my %ini; tie %ini, 'Config::IniFiles', ( -file => "test.ini" ); print Dumper \%ini; @hosts = keys %{$ini{'hosts'}}; @ips = values %{$ini{'hosts'}}; print Dumper \@hosts; print Dumper \@ips;
will print
$VAR1 = { 'hosts' => { 'host_1' => '192.168.1.1', 'host_2' => '192.168.1.2', 'host_3' => '192.168.1.3' } }; $VAR1 = [ 'host_1', 'host_2', 'host_3' ]; $VAR1 = [ '192.168.1.1', '192.168.1.2', '192.168.1.3' ];

Vivek
-- In accordance with the prarabdha of each, the One whose function it is to ordain makes each to act. What will not happen will never happen, whatever effort one may put forth. And what will happen will not fail to happen, however much one may seek to prevent it. This is certain. The part of wisdom therefore is to stay quiet.