Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I wouldn't characterize adding the comma at the end of the list to be work saving because it saves you adding the comma later.

What it saves you is editing the file twice when you do a line copy in your favorite editor (Yp in vi, for example,) to add that most recently discovered forgotten item and wind up with:

my %blah = ( one => 1, two => 2, three => 3 four => 4 );

And back you go for a single comma. If the last line has a comma, you can yank any line you want and can be sure it is safe to paste a copy back in. Adding the comma is for us non-perl-parsing-robot types who suffer from excessive human flaws. :) :)

See page 74 of the 3rd Camel, Larry and Tom thought to mention the benefit of null list items and optional terminating commas!

Update: ihb points out I skimmed the last couple lines from his post and missed that he does tailing commas for reordering. Oops. Still, my point goes to reordering the same as his, the tailing comma is 2nd order laziness: microscopic extra work now can save you quite a bit more work later. Adding the comma is essentially cost-free, but leaving it out means editing multiple lines when you edit, add, reorder, or remove from any list.

--
$you = new YOU;
honk() if $you->love(perl)


In reply to Re: Re: Re: Re: use base 'Foo' or die! by extremely
in thread use base 'Foo' or die! by jeffa

Title:
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 How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-19 01:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found