#!/usr/bin/perl -w use strict; use XML::Simple; use Data::Dumper; my $doc; open(FH, "inc.xml") || die "Can't open inc.xml"; sysread(FH, $doc, -s FH); close FH; my $xs = new XML::Simple; # can use forcearray and keeproot my $ref = $xs->XMLin("$doc"); # works print $ref->{incident}->{'GDOT-INC-260089'}->{location}->{county}->{co +ntent} . "\n"; # doesnt work print $ref->{'incident'}->[0];
In reply to Re: XML::Simple parsing :-(
by st4k
in thread XML::Simple parsing :-(
by st4k
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |