in reply to Help Using XML::Parser module

If you're a newbie to perl and XML, I wouldn't recommend using XML::Parser (actually, I'm not sure I would recommend it even if you weren't a newbie). Perhaps something like XML::Twig (by our own mirod) will present an easier interface to get you started parsing XML in perl... there's also XML::Simple, depending on how basic your XML parsing needs are...



Replies are listed 'Best First'.
Re: Re: Help Using XML::Parser module
by dsm (Novice) on Jun 12, 2003 at 04:10 UTC
    Thanks 3dan, I've decided to use XML::Simple, but just have one question which you (or perhaps someone else) may be able to answer...When writing XML files using this module, must the data be stored in a hash? or can you just tell it which parts is the <tags> and which part is XML bit?

      Yes, if you want to use XML::Simple to output XML then you do need to store the data in a hash. If it's not already in a hash then that might be a roundabout way of achieving your aims. You may also find that the loss of ordering which results from using a hash is a problem - if you don't get the results you want quickly then try another approach, XML::Simple's forte is really the reading side of things. There are one or two modules specifically for writing XML but I have no experience with them, print works for me.