> 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-Unix-Users mailing list. To unsubscribe go to 
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users

Reply via email to