in reply to Re^2: XML::LibXML out of memory
in thread XML::LibXML out of memory

You can check the nodetype in the condition:
while ($reader->nextPatternMatch($entry_pattern) && $reader->nodeType == XML_READER_TYPE_ELEMENT ) {

or, if more than one termEntry is expected,

while ($reader->nextPatternMatch($entry_pattern)) { if ($reader->nodeType == XML_READER_TYPE_ELEMENT) { ...

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^4: XML::LibXML out of memory
by Anonymous Monk on Mar 24, 2022 at 13:49 UTC

    Thanks.

    I got round the problem with

    next if $reader->nodeType != XML_READER_TYPE_ELEMENT;

    As recommended to me.