Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Problem w/ single-quoted stringsby bassplayer (Monsignor) |
on May 13, 2004 at 18:47 UTC ( [id://353179]=note: 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 Section
Seekers of Perl Wisdom
|
|