in reply to If hash not defined help

It sounds like you might be using XML::Simple. I would not recommend that module except for the very simplest of XML inputs, of which your XML is apparently not one, because the data structures it outputs are often unreliable, which would be exactly the problem you are experiencing. As a replacement I could suggest XML::Rules, which provides more reliable data structures as its output. Other good modules for reading XML are XML::LibXML (which supports XPath expressions) and XML::Twig.

Update: Added the bit about unreliable data structures.

Replies are listed 'Best First'.
Re^2: If hash not defined help
by johnfl68 (Scribe) on Jul 07, 2017 at 14:51 UTC

    Yes, I am using XML::Simple as I am on a shared server so I can't install modules. I've been using for years for a few other things, and it has been less of a headache on more complex XML. It was supposed to be a Simple XML solution, I don't understand why it is being a pain on these small file sets.

    I think XML::LibXML is also available, I will look at moving to that in the long term.

    As for the short answer, I'm about to just read each line one at a time and regex out the XML to get what I need for this, since it is so small. I know that is not really the right answer, but it will serve the purpose this time.

    "I have not failed 10,000 times. I have successfully found 10,000 ways that will not work." -- Thomas Edison

    Thanks to everyone for their help and feedback.