You need to escape all the regex metacharacters. See perldoc -f quotemeta and read about \Q in perlre. One way to do it:
$line =~ s/\Q$playertofind\E/$newplayer/g;
-sauoq "My two cents aren't worth a dime.";
In reply to Re: Simple file editing problems2
by sauoq
in thread Simple file editing problems2
by alpal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |