Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Re: HTML::Template question - tmpl_if

by djantzen (Priest)
on Dec 14, 2003 at 18:15 UTC ( #314660=note: print w/replies, xml ) Need Help??


in reply to Re: HTML::Template question - tmpl_if
in thread HTML::Template question - tmpl_if

Actually perl doesn't mid a bit if you have too many commas in a list, and in fact I've heard monks advocate a trailing comma to make it easier later to expand the list. I avoid doing it myself but mostly for aesthetic reasons.

use strict; use warnings; my @list = ('foo', 'bar',,,,'baz',,,,); print "Item $_\n" for @list; print "Length " . scalar @list."\n";
Note that perl even gets the length of the array correct.


"The dead do not recognize context" -- Kai, Lexx

Replies are listed 'Best First'.
Re: Re: Re: HTML::Template question - tmpl_if
by punkish (Priest) on Dec 14, 2003 at 18:48 UTC
    I stand corrected. And, I agree with you -- since I have always left the trailing comma out, I will continue to leave it out. Aesthetically it is more pleasing, and logically it achieves a closure. Good for the heart and the mind.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2020-05-27 07:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (153 votes). Check out past polls.

    Notices?