|
|
| Just another Perl shrine | |
| PerlMonks |
Re^7: Perl XML parsing with XML::Simple - Having problem with accessing fieldsby Mr. Muskrat (Abbot) |
| on Aug 17, 2012 at 20:01 UTC ( #988091=note: print w/ replies, xml ) | Need Help?? |
|
If you actually ran the code you posted, you would know what was wrong. syntax error at ./parse.pl line 13, near ") #" You lost the semicolon. It should be: print Dumper($config); # this prints out parsed xml Once that's fixed you'll encounter two more errors: Bareword "DATE" not allowed while "strict subs" in use at ./parse.pl line 13. Bareword "NOW" not allowed while "strict subs" in use at ./parse.pl line 13. Quote DATE-NOW: print $config->{DATA1}->{DATA2}->{'DATE-NOW'}, ".\n"; Now you'll see there are problems with the XML.. End tag mismatch (DATA1 != TIME) [Ln: 10, Col: 9] I'm assuming you typed it instead of using copy/paste. Here's the corrected XML:
Here's the code with the above corrections made:
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||