To create a regex pattern that matches a string of text, use quotemeta.
my $OldVerPat = quotemeta($OldVer); s/$OldVerPat/$NewVer/
quotemeta can be called via \Q..\E.
s/\Q$OldVer\E/$NewVer/
The \E can be ommitted since it's at the end of the pattern.
s/\Q$OldVer\E/$NewVer/
In reply to Re: Search/Replace action using "."
by ikegami
in thread Search/Replace action using "."
by rsperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |