tsk1979 has asked for the wisdom of the Perl Monks concerning the following question:

Normally lets say I want to replace "." with "/" its fairly easy for me. All I do is s/\./\//g, but now I have a problem. I have a script which has 2 inputs. First a text file name, and second the replacement character. So user will give
./replace.pl -file="file_name" -character="Some string"
Its working fine, but as soon as the user gives a character like ".", it breaks. Any simple workaround

Replies are listed 'Best First'.
Re: Perl, replacing a special charcter etc., after getting user input
by ikegami (Patriarch) on Jun 22, 2010 at 08:07 UTC