Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Re: Re: Re: use base 'Foo' or die!

by extremely (Priest)
on Feb 12, 2003 at 23:01 UTC ( [id://234855]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: use base 'Foo' or die!
in thread use base 'Foo' or die!

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)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://234855]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (7)
As of 2024-04-23 17:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found