Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: regex is hanging inside loop, neither going

by atcroft (Abbot)
on Dec 22, 2021 at 07:35 UTC ( [id://11139820]=note: print w/replies, xml ) Need Help??


in reply to regex is hanging inside loop, neither going

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11139820]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2025-12-12 16:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (92 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.