Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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

by extremely (Priest)
on Feb 12, 2003 at 23:01 UTC ( #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)


Comment on Re: Re: Re: Re: use base 'Foo' or die!
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2014-07-12 01:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (238 votes), past polls