vietboy505 Posted March 4, 2006 Share Posted March 4, 2006 I try to follow the example from [a href=\"http://search.cpan.org/~grantm/XML-Simple-2.14/lib/XML/Simple.pm\" target=\"_blank\"]XML Parse[/a] with foo.[code]#!/usr/local/bin/perluse XML::Simple;my $ref = XMLin('foo.xml');#also with my $ref = XMLin();use Data::Dumper;print Dumper($config);print $config->{logdir};[/code]where foo.xml[code] <config logdir="/var/log/foo/" debugfile="/tmp/foo.debug"> <server name="sahara" osname="solaris" osversion="2.6"> <address>10.0.0.101</address> <address>10.0.1.101</address> </server> <server name="gobi" osname="irix" osversion="6.5"> <address>10.0.0.102</address> </server> <server name="kalahari" osname="linux" osversion="2.0.34"> <address>10.0.0.103</address> <address>10.0.1.103</address> </server> </config>[/code]I try to test out foo.pl and get $VAR1 = undef;Why is that, it doesn't match the one with from the web. Link to comment https://forums.phpfreaks.com/topic/4068-perl-xml-parse/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.