Dermot Paikkos wrote: > Hi, > > I need to create a cgi program that will parse an xml file for > output. I haven't began to write anything yet but had a look at the > xml file I am going to work with. The snippet below contains 3 > records. > > My question is what would be the best (easiest/fastest) way to parse > the file. Should I try and set the record separator to something like > > $/ = "<record>\n"; > > Or should I use a XML::Parser (which looks a bit scary) or > XML::Simple (my first attempt at which failed). >
Use a module, hands down. XML::Simple should work well, can you show us your code and any failure messages and I bet we could set it straight. > I think i will eventally need to create a data structure like: > > $hashref = { > 'number' => 'S370/0128', > 'Date' => '03-Jun-05', > ....etc > > push(@myarray,$hashref); > > > Does anyone have an opinion on what would be the easiest way to parse > the data below? Will the '/' in the data be an problem? A module, specifically an XML parser. '/' shouldn't be a problem assuming it is correctly built XML. > Thanx. > Dermot. > http://danconia.org > ============== DATA ========== [snip] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>