Re: back slash problem

2007-10-26 Thread mAyur
On Oct 4, 5:19 pm, [EMAIL PROTECTED] (Praveena Vittal) wrote: > Hi All, > > I need a way to replace a backslash(ie:\) with \\ in a string. > > Please help me... > > eg:ssh\[[\d]*\] from [\d\.]* consider the string > > Regards, > Praveena $srt =~s/\\//g; -- To unsubscribe, e-mail: [EMAIL P

Re: back slash problem

2007-10-04 Thread Paul Lalli
On Oct 4, 8:19 am, [EMAIL PROTECTED] (Praveena Vittal) wrote: > I need a way to replace a backslash(ie:\) with \\ in a string. > > Please help me... $string =~ s{\\}{}g; The problem is that \ is a special character both to a regular expression and to a double quoted string, so it needs to b

Re: back slash problem

2007-10-04 Thread Jeff Pang
2007/10/4, Praveena Vittal <[EMAIL PROTECTED]>: > Hi All, > > I need a way to replace a backslash(ie:\) with \\ in a string. > Hi, See this test, $ perl -e ' > $str = "/usr/local/bin"; > $str =~ s|/|//|g; > print $str' //usr//local//bin Good luck! -- To unsubscribe, e-mail: [EMAIL PROTECTED

back slash problem

2007-10-04 Thread Praveena Vittal
Hi All, I need a way to replace a backslash(ie:\) with \\ in a string. Please help me... eg:ssh\[[\d]*\] from [\d\.]* consider the string Regards, Praveena -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/