develooper Front page | perl.perl5.porters | Postings from March 2003

Re: This Week on perl5-porters (10-16 March 2003)

Thread Previous | Thread Next
From:
Enache Adrian
Date:
March 17, 2003 17:27
Subject:
Re: This Week on perl5-porters (10-16 March 2003)
Message ID:
20030318012348.GA893@ratsnest.hole
On Tue, Mar 18, 2003 at 01:27:05AM +0100, H.Merijn Brand wrote:
> > 
> >     my $i;
> >     my %months = map {$_ => $i ++} qw /Jan Feb Mar Apr May Jun
> >                                        Jul Aug Sep Oct Nov Dec/;
> 
> Written less ambigous as
> 
> my %month;
> @month(qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)) = 0..11;

Sorry if slightly off-topic, but don't you think that
January is the 1st month of the year and December the 12th ? :)

 my %months = map {$_ => ++$i } qw /Jan Feb Mar Apr May Jun
                                    Jul Aug Sep Oct Nov Dec/;

 @month { qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec) } = 1..12;

Regards
Adi

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