in reply to s/// operator and binding
Personally, I feel the answer is rather ugly and I would avoid it. You may think it's okay, though.
(my $path = $logfilepath) =~ s/$ref_srv/$server/i;If $ref_srv has characters which might have a special meaning in a regex and you wish to avoid this:
(my $path = $logfilepath) =~ s/\Q$ref_srv\E/$server/i;Cheers,
Ovid
New address of my CGI Course.
Silence is Evil (feel free to copy and distribute widely - note copyright text)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: s/// operator and binding
by ibanix (Hermit) on Jan 28, 2003 at 00:27 UTC | |
by sauoq (Abbot) on Jan 28, 2003 at 00:39 UTC | |
by Cat (Initiate) on Jan 28, 2003 at 00:45 UTC | |
by Ovid (Cardinal) on Jan 28, 2003 at 00:45 UTC |