Re: replacing backslash




it_says_BALLS_on_your forehead wrote:
> Adam wrote:
> > Thanks for replying.. I tested that, but it doesnt give the desired
> > result, namely a output with 2 backslashes. Í've used this for
> > testing:
> >
> > $texT="This \ is my test";
> > $texT =~ s/\\/\\\\/g;
> > print $texT;
>
> that's because your initial string is in double quotes, and not single
> quotes. Perl is interpolating the '\ ' to mean an esaped space, which
> is essentially a space. try putting your initial string in single
> quotes.

perhaps i should have written that Perl is interpolating the "\ " to
mean an escaped space.

.