Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Escape from backslash hell

by Purdy (Hermit)
on Dec 01, 2001 at 00:41 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://128733]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-04-25 14:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found