Subject: | $err = $err->_prev() loop never returns false |
In some cases, calling "$err = $err->_prev()" in a loop never returns a
false value but starts to cycle through the same errors over and over
again.
The script below and the JBR-ALLENtrees.htm attachment from
http://lists.w3.org/Archives/Public/www-validator/2010Apr/0040.html
demonstrates it, it ends up in an apparently infinite loop. If I remove
the eval from the script (which isn't a good thing if I want all errors
reported I gather from the docs), it completes normally, reporting
issues only once.
------
use XML::LibXML;
my $parser = XML::LibXML->new();
$parser->validation(0);
$parser->load_ext_dtd(0);
eval {
$parser->parse_file("JBR-ALLENtrees.htm");
};
my $err = $@;
while ($err) {
print $err, "\n";
$err = $err->_prev();
}