bob@dhw68k.cts.com (Bob Best) (07/16/88)
The man page for perl 2.0 states (on page 6):
String literals are delimited by either single or double
quotes. They work much like shell quotes: double-quoted
string literals are subject to backslash and variable
substitution; single-quoted strings are not.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Perl considers '\\\\' identical to "\\\\" as evidenced by the following:
if ('\\\\' eq "\\\\") {print "equal\n";} else {print "not equal\n";};
Compare this with:
if ('\n\n' eq "\n\n") {print "equal\n";} else {print "not equal\n";};
--
Bob Best
uucp: ...{trwrb,hplabs}!felix!dhw68k!bob InterNet: bob@dhw68k.cts.comlwall@devvax.JPL.NASA.GOV (Larry Wall) (07/19/88)
In article <9683@dhw68k.cts.com> bob@dhw68k.cts.com (Bob Best) writes:
: The man page for perl 2.0 states (on page 6):
: String literals are delimited by either single or double
: quotes. They work much like shell quotes: double-quoted
: string literals are subject to backslash and variable
: substitution; single-quoted strings are not.
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
: Perl considers '\\\\' identical to "\\\\" as evidenced by the following:
:
: if ('\\\\' eq "\\\\") {print "equal\n";} else {print "not equal\n";};
:
: Compare this with:
:
: if ('\n\n' eq "\n\n") {print "equal\n";} else {print "not equal\n";};
OK, minor clarification. Single quoted strings DO pay attention to
backslashes, but only in front of single quotes or backslashes.
Sorry, I'll fix the doc.
Larry