in reply to problem with a regex loop
If you had indented and put in some whitespace you would see:
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 {.for my $line (@lines){ if( $Session->{'usrSystem'} )=~/$line/g; $Response->Write("Found a match! Hooray"); }
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...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: problem with a regex loop
by grashoper (Monk) on Oct 30, 2007 at 21:53 UTC |