I do know that '+' is a special character, but in any other place besides the first position, it works correctly. I have previously tried "\+44", and received the same error message.
But as you suggest, I changed the code to
perl -e '$in=quotemeta("+44"); $out=$in; $out =~ s/$in//; print "Result: |$in|$out|\n";'However, the result was incorrect: Result: |\+44|\|
Thank you.
In reply to Re^2: Substitution, '+' in first position of Pattern
by flexvault
in thread Substitution, '+' in first position of Pattern
by flexvault
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |