Static has asked for the wisdom of the Perl Monks concerning the following question:
greetings monks --
trying to convert string '11/29/2001' to string '11\/29\/2001'.
i have attempted several conversions to no avail:
$dt =~ s/\//\\\//g $dt =~ s{/}{\/}g $dt =~ s{/}{\\/}g
all of my attempts thus far have failed to produce the desired result, all return either the original string or 11\\/29\\/2001.
i know this is an easy one, but it's trapped behind the cobwebs of many beers in my mind.
thanks for the help.
edited by footpad, ~Fri Nov 30 21:16:31 2001 (GMT)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Escape from backslash hell
by Rich36 (Chaplain) on Dec 01, 2001 at 00:41 UTC | |
by tilly (Archbishop) on Dec 01, 2001 at 08:04 UTC | |
Re: Escape from backslash hell
by patgas (Friar) on Dec 01, 2001 at 00:38 UTC | |
Re: Escape from backslash hell
by Purdy (Hermit) on Dec 01, 2001 at 00:41 UTC | |
Re: Escape from backslash hell
by lestrrat (Deacon) on Dec 01, 2001 at 00:39 UTC | |
Re: Escape from backslash hell
by Static (Initiate) on Dec 01, 2001 at 00:46 UTC | |
Re: Escape from backslash hell
by dws (Chancellor) on Dec 01, 2001 at 07:24 UTC | |
Re: Escape from backslash hell
by chipmunk (Parson) on Dec 01, 2001 at 09:57 UTC | |
(crazyinsomniac) Re: Escape from backslash hell
by crazyinsomniac (Prior) on Dec 01, 2001 at 05:45 UTC | |
by impossiblerobot (Deacon) on Dec 01, 2001 at 07:12 UTC |
Back to
Seekers of Perl Wisdom