|
|
|
Clear questions and runnable code get the best and fastest answer |
|
| PerlMonks |
Re: regex is hanging inside loop, neither goingby atcroft (Abbot) |
| on Dec 22, 2021 at 07:35 UTC ( [id://11139820]=note: print w/replies, xml ) | Need Help?? |
|
Your code hangs in the getEleMul subroutine when $i hits 32, which appears to be at or around the time it hits the end of the particular <div> you are in. The regex in the while() loop continues to attempt to match $_[1], which is where I believe your headache comes in. (Mine was in trying to read that complicated regex.) I suspect it is the backtracking you are asking the regex engine to do to find another match that is the cause of your issue. You might consider dropping in Regexp::Debugger to help debug why the regex issue is occurring. Hope that helps.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||