Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Escape from backslash hell

by Purdy (Hermit)
on Dec 01, 2001 at 00:41 UTC ( #128733=note: print w/replies, xml ) Need Help??


in reply to Escape from backslash hell

I know several other Monks will jump on this, too, but here's my answer. :)

#!/usr/bin/perl -w use strict; my $date = '11/29/2001'; print "DATE (before): $date\n"; $date =~ s/\//\\\//g; print "DATE (after): $date\n";

Output:
$ ./slash.pl
DATE (before): 11/29/2001
DATE (after): 11\/29\/2001

Jason

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://128733]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2019-11-22 20:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (113 votes). Check out past polls.

    Notices?