Hi,
I am using unix platform to develop simple perl xml program. SunOS 5.9 is the unix version. Also i have installed perl 5.6.1. but i couldnt find the XML package in /usr/perl5/5.6.1/lib. Is this version support XML programming in perl?.
Below is the simple XML program.
use XML::Simple;
use Data::Dumper;
# create array
@arr = [
{'country'=>'england', 'capital'=>'london'},
{'country'=>'norway', 'capital'=>'oslo'},
{'country'=>'india', 'capital'=>'new delhi'} ];
# create object
$xml = new XML::Simple (NoAttr=>1, RootName=>'data');
# access XML data
print Dumper($data);
Ouput:
Can't locate XML/Simple.pm
Can anyone of you help me what am doing wrong?
20070116 Janitored by Corion: Added formatting, code tags, as per Writeup Formatting Tips
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.