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.
In reply to Re^3: Perl XML parsing with XML::Simple - Having problem with accessing fields
by Mr. Muskrat
in thread Perl XML parsing with XML::Simple - Having problem with accessing fields
by vparikh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |