in reply to Re: XML parsing
in thread XML parsing

Using your code, I get the following error

Pseudo-hashes are deprecated at ./test.pl line 19.

Replies are listed 'Best First'.
Re^3: XML parsing
by crashtest (Curate) on May 10, 2005 at 03:17 UTC
    Please don't just "use my code". Your XML file is different from the block I used, in that I only have one host and you have several.

    The key point (I'm sorry if it wasn't clear) I was making was that XML::Simple returns a reference to an array when there is more than one element with the same name. You need to either differentiate between the "singular" and the "plural" using ref, or force the element to be an array reference all the time using ForceArray => 1 in your options.

    The structure and form of the data XML::Simple returns depends on the XML it parses. I think that's the crux of your problem.