There doesn't appear to be any express support within XML::Parser for interrupting the parse. I would suggest you consider employing an exception to stop the parse. Consider the following code. Also think about using the Exception::Class to further clarify that the parse is being interrupted for valid reasons instead of depending on a text message in the $@ variable.
eval { $p->parse( ... ) }; if ($@ =~ /^Interrupted parsing/) { # The parse was stopped early. } sub whatever_handler { if ( $found_record ) { die "Interrupted parsing"; } }
In reply to Re: XML::Parser question
by diotalevi
in thread How to tell XML::Parser to stop?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |