Good advice in general,
but in this case there'll only be one interation.
Update: Fastolfe's right...my bad...mea culpa
~monk d4vis
#!/usr/bin/fnord
| [reply] |
Why? If we were sure the match would always occur on the first line, why search for it at all?
| [reply] |
Incorrect. It will not be compiled on every iteration, but its string form will be compared with its previous string form, to see whether it needs recompiling.
_____________________________________________________
Jeff[japhy]Pinyan:
Perl,
regex,
and perl
hacker, who'd like a job (NYC-area)
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??; | [reply] |
Thanks, I remember reading that it still did the recompile even if the variable in the regex did not change. Of course I read that a LONG time ago. Apparently it has been fixed.(probably a long time ago) So would the /o faster by avoiding the extra string compare? I know this would probably be insignificant unless there where a bajillion iterations. But I was just curious. Do you even know anything about regexes? (see sig) -- flounder Do you even know anything about perl? --Anonymous Coward to Tom Christiansen on slashdot
| [reply] |
That's JAN-AR-IK..(like generic) Just another Regexp Question.
Also it might be worth mentioning that meta characters in $regex will still be parsed. Make sure you intended that to happen.
--
Brother Frankus.
¤
| [reply] |