OK, first off, I'm a bit confused, because your first line says 'Testing\z'. Perhaps you meant 'Testing\n' ?
With that out of the way, you are missing something -- or rather, the document you just quoted is missing something.
It handles three cases:
- Any character OTHER than a backslash or termination character is inserted literally. (The termination character is normally ' but may differ if q// is used.)
- Any backslash followed by the termination character inserts the termination character.
- Any backslash followed by a backslash inserts a backslash.
What it doesn't tell you is the fourth case:
- Any backslash followed by a character OTHER than the termination character or a backslash inserts a backslash and that literal character.
The reason for the double-backslash thing is in case you wanted to include a backslash at the end of the string.
For example:
$foo = 'C:\\'; # if you had 'C:\' then the ' would instead be escaped
+instead of ending the string.
--Stevie-O
$"=$,,$_=q>|\p4<6 8p<M/_|<('=>
.q>.<4-KI<l|2$<6%s!<qn#F<>;$,
.=pack'N*',"@{[unpack'C*',$_]
}"for split/</;$_=$,,y[A-Z a-z]
{}cd;print lc
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.