On 7/7/06, Cai, Lucy (L.) <[EMAIL PROTECTED]> wrote:
>
> If my file path is like
>
> My $file = "c:\test/test.txt";
>
> How can I switch "/" to "\"?

$file =~ s#/#\\#g;

Test case:
perl -e "\$f = qq(C:\\\\test/test.txt); \$f =~ s#/#\\\\#; print \$f"

-- 
pDale Campbell
"All of the birds are laughing!
 C'mon, let's all join in."
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to