Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

I finally get to help. *Smiles*

by Rhose (Priest)
on Aug 22, 2001 at 01:26 UTC ( #106784=note: print w/replies, xml ) Need Help??


in reply to XML format help

What you are experiencing can be corrected by setting forcearray => 1 with XMLin(). I threw together a quick example which will demonstrate the differences. (Your sample XML file is in.xml.)

One other thing I have found to be helpful when working with XML::Simple is Data::Dumper.

#-- Sample code use strict; use XML::Simple; my $mXML; print "Without forcearray...\n"; $mXML = XMLin('./in.xml'); print XMLout($mXML); print "\n\n"; print "With forcearray...\n"; $mXML = XMLin('./in.xml',forcearray => 1); print XMLout($mXML);

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://106784]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2019-08-24 22:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?