I would use  while (<>) { ...} only because it has been
hammered into me as the idiom.
This is not an argument for the usage.

No no warnings; because I use 5.005.

use constant CONSTANT => "value"; is better for any code where
the difference might matter. For simple & well contained
code I have the bad habit of
 my $VAR = "value";     # XXX constant

Definitely my ($foo, $bar) = @_; this is crystal clear
and screen space is valuable. I do find that I don't use
my ($foo, $bar, @valuable) = @_; though.

Regarding for ( @array) versus foreach (@array) , I don't
care much. I use foreach for this and use for for C-style loops.
I'd nearly never use $_ here. I rarely use implicit $_
except for the most common idioms. Though I'm usually
using Perl I don't want to develop overly specialized finger
habits.

Always print 'foo'; I don't follow print statements with
more code on the same line.

Breaking the C habit of using qq quotes had some appeal.
Then I coded a lot of print statements. qq usage is more
flexible, save q for when you have to use it.

glob '*' or <*>
I would lean toward glob but I have not used either construct.

Again <FOO> is the standard idiom.

I find keys is the most natural way to go through a hash.


In reply to Re: Style, style, style by rir
in thread Style, style, style by Juerd

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.