in reply to Assigning variables and persistence using Lib::LibXML::Reader

THANK YOU ALL!! I was banging my head against the wall all day over this. I tried to declare variable every which way and I couldn't figure out why it wasn't working. Debug tips are great. The problem was indeed the opening and closing tags were the issue so doing the //= worked as well as adding nodeType:

$price = $reader->readInnerXml if $reader->localName eq 'price' && + $reader->nodeType == 1;

Whew! Glad that is over with. This has been very educational. Been a long time lurker and learner from all your wisdom here. Thanks so much.

Replies are listed 'Best First'.
Re^2: Assigning variables and persistence using Lib::LibXML::Reader
by ikegami (Patriarch) on Apr 03, 2017 at 04:46 UTC

    Please use the constants exported by XML::LibXML instead of 1!!!

      They havent changed in more than a decade!

        Wow, there are so many actual problems, a mere potential problem such as that one didn't even enter my mind.