perl 2.0 ('\\\\' eq "\\\\") bug?

Larry Wall lwall at devvax.JPL.NASA.GOV
Tue Jul 19 04:46:25 AEST 1988


In article <9683 at dhw68k.cts.com> bob at 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



More information about the Comp.sources.bugs mailing list