Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

This regex: is there something bad there?..

by Doctrin (Beadle)
on Feb 13, 2013 at 19:07 UTC ( #1018605=perlquestion: print w/ replies, xml ) Need Help??
Doctrin has asked for the wisdom of the Perl Monks concerning the following question:

Hello dear Monks! I suspect that following regex puts the server down (sic, it is executed much times). So, is there something bad in this regex? if($Inapp=~/refill_(\d+)\.$/){ I don't know how and why, but if I put if(0) here, all is OK :( I've made the body of condition completely EMPTY for tests to be sure that regex is the case. So, when I try to browse a page, generated by a script containing this regex - it hangs forever. And if I get rid of this regex - all ok. Is there any reasonable explanation of that (including my stupidity, maybe)? UPD: Thanx, problem resolved; the regex was not the case...

Comment on This regex: is there something bad there?..
Select or Download Code
Replies are listed 'Best First'.
Re: This regex: is there something bad there?..
by Anonymous Monk on Feb 13, 2013 at 19:22 UTC

    There's nothing wrong with the regex. It will change $1 however. Is your code using $1 after the if and going into an infinite loop because the value isn't what you expect?

Re: This regex: is there something bad there?..
by mendeepak (Scribe) on Feb 14, 2013 at 05:02 UTC

    This regex looks fine to me. Is there any that is using this regex below that piece of code, look in to that as well i guess it might be the problem.

    *=*=*dEEPAk*=*=*

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1018605]
Approved by muba
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (11)
As of 2015-07-28 07:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (253 votes), past polls