--- Allen Wang <[EMAIL PROTECTED]> wrote:
> I want to change the string  "d:\orant\oracle" to "d:\\orant\\oracle"
> 
> Anyone know how to do this?
> 
> 
> Thanks,
> allen

I'm not sure exactly what this stemmed from, so my comment may be out of place, but 
Perl is
portable and will let you use the forward slash in file paths.  With an absolute path 
it's not as
useful, but a relative path such as "../images/foo.jpg" could be just the same on a 
Windows box as
a Linux box as a Mac Box...

With that in mind:

    $path =~ s{\\}{/}g;

Cheers,
Curtis "Ovid" Poe

=====
"Ovid" on http://www.perlmonks.org/
Someone asked me how to count to 10 in Perl:
push@A,$_ for reverse q.e...q.n.;for(@A){$_=unpack(q|c|,$_);@a=split//;
shift@a;shift@a if $a[$[]eq$[;$_=join q||,@a};print $_,$/for reverse @A

__________________________________________________
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to