in reply to Re: Substitution, '+' in first position of Pattern
in thread Substitution, '+' in first position of Pattern
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Substitution, '+' in first position of Pattern
by JavaFan (Canon) on Oct 01, 2010 at 10:40 UTC | |
|
Re^3: Substitution, '+' in first position of Pattern
by suhailck (Friar) on Oct 01, 2010 at 10:44 UTC | |
by flexvault (Monsignor) on Oct 01, 2010 at 11:13 UTC | |
|
Re^3: Substitution, '+' in first position of Pattern
by Anonymous Monk on Oct 01, 2010 at 10:41 UTC | |
|
Re^3: Substitution, '+' in first position of Pattern
by gobisankar (Acolyte) on Oct 01, 2010 at 10:25 UTC |