[JaxPM] XML::Simple

Bill Jones sneex at fccj.org
Tue Oct 30 10:33:03 CST 2001


On the jacksonville-pm-list; Jax.PM'er Bill Jones <sneex at fccj.org> wrote -

[For Jax.PM Perl Beginners]

If you haven't seen XML::Simple yet - here is an example of what 
you can do:

#!/usr/local/bin/perl -w

my $config = {
'logdir'        => '/var/log/foo/',
'debugfile'     => '/tmp/foo.debug',
'server'        => {
          'sahara'        => {
                             'osversion'     => '2.6',
                             'osname'        => 'solaris',
                             'address'       => [ '10.0.0.101', 
'10.0.1.101' ]
                             },
          'gobi'          => {
                             'osversion'     => '6.5',
                             'osname'        => 'irix',
                             'address'       => '10.0.0.102'
                             },
          'kalahari'      => {
                             'osversion'     => '2.0.34',
                             'osname'        => 'linux',
                             'address'       => [ '10.0.0.103', 
'10.0.1.103' ]
                             },
          },
};

print $config->{logdir};

print $config->{server}->{kalahari}->{address}->[1];

Enjoy!
-Sx-


Jax.PM Moderator's Note:
This message was posted to the Jacksonville Perl Monger's Group listserv.
The group manager can be reached at -- owner-jacksonville-pm-list at pm.org
to whom send all praises, complaints, or comments...




More information about the Jacksonville-pm mailing list