in reply to I think I'm starting to get it
Actually, Perl doesn't reinterpolate strings. Two backslashes should be enough. This sounds like a bug.
As an example, if I do: $str= "C:\\Windows" and then try to use $str in a regular expression: if( $path =~ /^$str/i ) { then this won't work. But that is because I made a mistake. I should have written: if( $path =~ /^\Q$str\E/i ) { to tell the regular expression that I wanted it to parse $str as a string and not as a regular expression. (I also made a mistake in trying to use a regular expression to compare file paths as the resulting code is not portable.)
I have a hard time coming up with cases other than regular expressions and eval where it is easy to get Perl to interpolate a string a second time. Perhaps you could do some more digging and find where this second interpolation is happening so that a fix could be made (or so I could understand why it isn't a bug in this case).
- tye (but my friends call me "Tye")
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: I think I'm starting to get it
by cLive ;-) (Prior) on Apr 04, 2001 at 23:49 UTC | |
by tye (Sage) on Apr 04, 2001 at 23:55 UTC | |
|
Re: (tye)Re: I think I'm starting to get it
by extremely (Priest) on Apr 05, 2001 at 02:33 UTC | |
|
Re: (tye)Re: I think I'm starting to get it
by coolmichael (Deacon) on Apr 10, 2001 at 10:53 UTC | |
by tye (Sage) on Apr 10, 2001 at 18:37 UTC |