develooper Front page | perl.perl6.language | Postings from July 2005

Re: Time::Local

Thread Previous | Thread Next
From:
Dave Rolsky
Date:
July 5, 2005 16:26
Subject:
Re: Time::Local
Message ID:
Pine.LNX.4.61.0507051539590.27460@urth.org
On Tue, 5 Jul 2005, Juerd wrote:

> No. Humans don't USE numbers for week days! So beginning at 1 makes no
> sense, except for humans who like creating lists like (undef, <Sunday
> Monday ...>). In fact, I would prefer <Saturday Sunday Monday ...> to
> not having any 0 :)

This should be separated into day() and day_name().  It's hardly obvious 
that day() should return a string, much less a bit of English!

As for 0 vs 1 as the index, I think this is a bit of a red herring.  If 
you're constantly using this as an array index you're operating at too low 
a level (IMO).  If all your programs start with:

  my @DayNames = qw( Sunday Monday Tuesday ... );

I think you have a bigger problem than simply adjusting for a 1-indexed 
day number ;)


-dave

/*===================================================
VegGuide.Org                        www.BookIRead.com
Your guide to all that's veg.       My book blog
===================================================*/

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About