Re: substitution
- From: tom@xxxxxxxxxxxxxx (Tom Phoenix)
- Date: Sun, 12 Feb 2006 13:41:15 -0800
On 2/12/06, Bowen, Bruce <Bowenb@xxxxxxxxxxx> wrote:
I have a text string = "^0176 ^0176"
I have set $a = "^0176 ^0176";
I have set $b = "^0176 ";
I'm using text =~ s/$a/$b/g;
And the text string doesn't change.
The caret is a metacharacter. You may want to use \Q or the
quotemeta() function to quote metacharacters in the interpolated $a.
Hope this helps!
--Tom Phoenix
Stonehenge Perl Training
.
- References:
- substitution
- From: Bruce Bowen
- substitution
- Prev by Date: Trouble with line endings
- Next by Date: Trying to undersatnd slices in arrays
- Previous by thread: substitution
- Next by thread: Re: substitution
- Index(es):