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

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?

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2021-01-24 10:06 GMT
Find Nodes?
    Voting Booth?