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)
In reply to Re: s/// operator and binding
by Ovid
in thread s/// operator and binding
by ibanix
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |