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.
Printable View
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.
its a \ same as in javascript so
print "hello\"dave\"";
would print
hello "dave"
;)
No, it would print:Quote:
Originally posted by progressive
its a \ same as in javascript so
print "hello\"dave\"";
would print
hello "dave"
;)
:pQuote:
hello"dave"
smart arse ;)
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";