Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re^5: conf file in Perl syntax

by targetsmart (Curate)
on Jun 11, 2009 at 11:05 UTC ( #770601=note: print w/ replies, xml ) Need Help??

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' => '', 'host_2' => '', 'host_3' => '' } }; $VAR1 = [ 'host_1', 'host_2', 'host_3' ]; $VAR1 = [ '', '', '' ];

-- 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.

Comment on Re^5: conf file in Perl syntax
Select or Download Code
Replies are listed 'Best First'.
Re^6: conf file in Perl syntax
by Ravendark (Acolyte) on Jun 11, 2009 at 11:33 UTC
    thank you!!! That was what I was looking for!! Thanks alot!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://770601]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2015-11-26 17:54 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (705 votes), past polls