>From `perldoc perldata`:
String literals are usually delimited by either single or double quotes. They work much like quotes in the standard Unix shells: double-quoted string literals are subject to backslash and variable substitution; single-quoted strings are not (except for "\'" and "\\"). You need \’ to be an escape, otherwise single quoted strings can’t include single quotes themselves. And consequently you need \\ to be an escape, otherwise single quoted strings couldn’t end with a backslash (it would just be an escaped single quote). So you’ll unfortunately still need to double backslashes once you have more than one in a row, like in UNC filenames). Cheers, -Jan From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Greg Aiken Sent: Wednesday, October 20, 2010 10:10 AM To: perl-win32-users@listserv.activestate.com Subject: lame question "\\\\.\\pipe\\pipename" vs '\\.\pipe\pipename' forgive my ignorance here, but I thought single quoted, or apostrophized [however you call this character] (‘) text strings were supposed to be interpreted by perl in an unaltered manner. sample code, indicating how to reference a named pipe in the Win32::Pipe module, shows something like this… “\\\\.\\pipe\\pipename <file:///\\pipe\pipename> ” (note enclosed in quotes) I thought the excessive quantities of backslashes seemed silly, so I instead used single quotes and tried… ‘\\.\pipe\pipename’ (note enclosed in apostrophies) only to find that my client pipe program did not work. I then did a simple test print program; print ‘\\.\pipe\pipename’; and I was surprised to see what actually printed to the screen was instead; \.\pipe\pipename (note the first \ is not shown in output!) this explained why my client pipe program was working… but it left me scratching my head to ask, “why is the backslash character being interpreted as a special perl operator when it is found within apostrophies?” I thought that only happened when the backslash is found within quotes, such as (print “\x43”), which should print a capital C thanks in advance to anyone who can explain this to me.
_______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs