|
-
Dec 23rd, 2002, 06:36 AM
#1
Thread Starter
Lively Member
" escape code in Perl
A simple question:
Whats the escape code for a " in a Perl string? I need it as HTML uses "s, and my Perl script would obviously treat it as the end of the string parameter as just a ", which would mess up the HTML.
Thanks in advance.
-
Jan 3rd, 2003, 12:16 PM
#2
Hyperactive Member
its a \ same as in javascript so
print "hello\"dave\"";
would print
hello "dave"
-
Jan 7th, 2003, 10:05 PM
#3
Stuck in the 80s
Originally posted by progressive
its a \ same as in javascript so
print "hello\"dave\"";
would print
hello "dave"
No, it would print:
-
Jan 8th, 2003, 04:01 AM
#4
-
Jan 8th, 2003, 11:19 AM
#5
Black Cat
You can also used ' to delimit strings - then you only need to escape the ' and \, but you lose variable interpolation:
Code:
print 'Hello "Dave"' . "\n";
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|