in reply to Question of variable interpolation in regex
This line $boxLine =~ s/\.+/$string/o; uses the /o modifier, so the regular expression is only compiled once. That is, even if the value of $string changes, the regular expression won't reflect that. So the first time through, it compiles as s/\.+/ 1/o and never changes again.
updated: Apparently, I'm talking rubbish. Sorry!
--
Tommy
Too stupid to live.
Too stubborn to die.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Question of variable interpolation in regex
by thelenm (Vicar) on Nov 15, 2002 at 16:56 UTC |