in reply to Solved: Regex syntax frustration

My guess is that somewhere on a previous line, you forgot a string delimiter. Or perhaps you forgot a semi-colon on the previous line. It would help if you could provide us with a short piece of code that doesn't compile.

Abigail

Replies are listed 'Best First'.
Re: Re: Regex syntax frustration
by bigmacbear (Monk) on May 26, 2004 at 23:35 UTC

    I tried to do that by including the several lines preceding the regex (the while loop) in the test program, which compiled and ran. So I must not have grabbed code back far enough to include the error.

    I cut and pasted the entire subroutine containing the while loop. Lo and behold I found the problem: this is a CGI script (which is why taint checking is on) and I forgot the $ on my CGI object, five lines above my while loop. So instead of "$q->p()" I had "q->p()". Aargh.

    The lesson to be learned here is when you are done looking for missing semicolons and string delimiters, look next for missing dollar signs on variables (especially objects).

    Thanks much for breaking me out of a "tight mental loop" around that damned regex. ;-)