Using the stricture adds, uhm, exactly
nothing at all to the above program. It just increases the size of the program text. As for adding -l, I tend to only do that for only liners - with normal programs, you just want to use 'print' without newlines often enough to make it a nuisance (it's still possible by using printf though). I disagree with the remark in update2 though. "Just calling the script using 'perl -l'" is a major PITA. You want to call program by just typing their file names, having to remember which interpreter they need is hard - and it's even harder to remember which program needs which command line options! Not to mention that that will make debugging even harder than having -l mentioned in the she-bang line - that's easier to spot than the -l enforced on the program from the outside.
However, I only write this node because of something else. What's with the quotes around $_ in the print statement? If you're going to nag about (pointless in this case) missing "use strict" statements, and whether or not to use -l vs. a newline, you should at least get rid of the not needed quotes around the variable.
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.