Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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"); } }

One dead unjugged rabbit fish later...

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://648118]
[marto]: I'm sure this comes as a surprise to no one
[LanX]: ?
[marto]: poorly thought out non products, sold to parents as "fun" things for kids to have, while providing "security" features (track your kid over the interwebs)
[LanX]: oh didn't see the link, poor contrast
[marto]: "Through a few simple steps, a stranger can take control of the watch and track, eavesdrop on and communicate with the child. They will be able to track the child as it moves or make it look like the child is somewhere it is not..." and so on
[LanX]: so Strangers can easily seize control of the children
LanX needs a smartwatch for his boss ...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (12)
As of 2017-10-20 14:13 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (263 votes). Check out past polls.