* No here-documents, but multi-line q/qq. Even repeated prints are better :)
The here-doc end marker cannot be indented, and I don't want something to be outdented in the middle of something that should be indented. Adding the indent spaces to the end marker means code stops working if it changes, which is VERY bad.
That's actually not true about the here-doc end marker not being able to be indented. pgs. 23-26 (ch. 1.11) of the Perl Cookbook give a few examples of how to do that. Below is an example with 4 space indents in front of each of the lines.
(my $text = <<' EOT') =~ s/^\s+//gm;
This is a test of the multi-line, indented HERE
This code strips out the leading spaces in the text so
that you don't have extra spaces there. It still has the drawback that if you change the spacing it will break
unless you adjust the <<' EOT' declaration as well, but at least it lines up better in the code.
On another note, great list and thanks for sharing it.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||