in reply to Re^2: Perl XML parsing with XML::Simple - Having problem with accessing fields
in thread Perl XML parsing with XML::Simple - Having problem with accessing fields
Since you didn't provide your actual XML, I had to dummy some up based on the dump you provided.
<root> <Data1> <TIMESTAMP>2012-08-04T20:15:04.506-04:00</TIMESTAMP> <Data2> <DATE>2000-10-19</DATE> <ID>A95</ID> <STATUS>A</STATUS> <TIME></TIME> </Data2> </Data1> </root>
Using a slightly modified version of your script, I'm able to print the date.
use strict; use warnings; use XML::Simple; # qw(:strict); use Data::Dumper; my $simple = XML::Simple->new(); my $config = $simple->XMLin('parse3.xml'); # /home/parse3.xml isn't va +lid on my system #print Dumper( $config ); # Uncomment to get a dump of the data struct +ure print $config->{Data1}->{Data2}->{DATE}, ".\n"; __END__ Output: 2000-10-19.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Perl XML parsing with XML::Simple - Having problem with accessing fields
by vparikh (Novice) on Aug 17, 2012 at 18:41 UTC | |
by roboticus (Chancellor) on Aug 17, 2012 at 18:52 UTC | |
by Mr. Muskrat (Canon) on Aug 17, 2012 at 19:01 UTC | |
by vparikh (Novice) on Aug 17, 2012 at 19:39 UTC | |
by Mr. Muskrat (Canon) on Aug 17, 2012 at 20:01 UTC | |
by vparikh (Novice) on Aug 20, 2012 at 13:15 UTC |