Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: problem with a regex loop

by grep (Monsignor)
on Oct 30, 2007 at 21:26 UTC ( #648118=note: print w/ replies, xml ) Need Help??


in reply to problem with a regex loop

This is one big reason to indent.

If you had indented and put in some whitespace you would see:

for my $line (@lines){ if( $Session->{'usrSystem'} )=~/$line/g; $Response->Write("Found a match! Hooray"); }
Right there I can look at that code and see that the if isn't closed. And I notice that the if is missing an opening curly {.

If I just look at (instead of read) this code I can instantly tell the blocks look balanced

foreach my $line (@lines) { if ( $Session->{'usrSystem'} =~ /$line/g ) { $Response->Write("Found a match! Hooray"); } }

grep
One dead unjugged rabbit fish later...


Comment on Re: problem with a regex loop
Select or Download Code
Re^2: problem with a regex loop
by grashoper (Monk) on Oct 30, 2007 at 21:53 UTC
    your right, I will definitely try to indent more often, and thanks for the help, I am getting closer to my goal which is to make this a switch for the main app, due to upgrades content needs to change on a rolling upgrade schedule.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2014-07-30 06:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (229 votes), past polls