You could:
$SIG{ALRM} = sub{die "too long"}; my $xSecs = 1; my $content = ""; eval { alarm $xSecs; my $p = HTML::TreeBuilder->new (); $p->parse($content); alarm 0; }; print "Died after waiting $xSecs" if $@ =~ /^too long/;
In reply to Re: Parsing with HTML::TreeBuilder hangs
by GrandFather
in thread Parsing with HTML::TreeBuilder hangs
by casimo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |