Re: substitution



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
.