[EMAIL PROTECTED]
eState.com Subject: Re:
[Perl-unix-users
> Need help!
>
> I would like to insert a \ before a $ (if found) in the following string:
>
> $x = '123456$1$2$3';
>
> Output of $x must be 12345\$1\$2\$3.
>
> How do I this?
>
($x = '123456$1$2$3') =~ s/\$/\\\$/g;
print $x;
--till
___
Perl
[EMAIL PROTECTED] wrote:
> Need help!
>
> I would like to insert a \ before a $ (if found) in the following string:
>
> $x = '123456$1$2$3';
>
> Output of $x must be 12345\$1\$2\$3.
>
> How do I this?
Untested:
$x =~ s/\$/\\\$/g; # last \ may be unnecessary
--
,-/- __ _
Need help!
I would like to insert a \ before a $ (if found) in the following string:
$x = '123456$1$2$3';
Output of $x must be 12345\$1\$2\$3.
How do I this?
Many thanks.
___
Perl-Unix-Users mailing list. To unsubscribe go to
http://listserv.