|
|
| go ahead... be a heretic | |
| PerlMonks |
Re: Test for the last element in a foreachby CountZero (Bishop) |
| on Aug 02, 2007 at 20:30 UTC ( [id://630391]=note: print w/replies, xml ) | Need Help?? |
|
I was thinking of:
Output:
You can leave out the scalar function but then you have to take care that the test does not get evaluated in list context. CountZero A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||