Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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

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

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

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2021-08-05 18:23 GMT
Find Nodes?
    Voting Booth?
    My primary motivation for participating at PerlMonks is: (Choices in context)

    Results (44 votes). Check out past polls.