Keep It Simple, Stupid | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Variables and some escaped characters are not interpolated when between single quotes. The newline character referred to in your quote is the real character, not the \n representation. To get a new line, your test code would have to be doing something like this:
Concerning your code sample, the first line prints the word 'Testing' followed by the characters '\' and 'n'. The second line prints the word 'Testing' followed by a backslash, created by escaping a backslash (\\), followed by 'n'. The third line prints the word 'Testing' followed by a backslash created by escaping a backslash, followed by the characters '\' and 'n'. Double quotes will allow escaped characters and variables to be interpolated. You can also use qq{}. Update: added some extra detail bassplayer In reply to Re: Problem w/ single-quoted strings
by bassplayer
|
|