develooper Front page | perl.perl5.porters | Postings from November 1999

Re: PROPOSAL: D'oh::Year [was: Re: Making -DPERL_Y2KWARN useful after 946684800]

Thread Previous | Thread Next
From:
Mark-Jason Dominus
Date:
November 6, 1999 10:39
Subject:
Re: PROPOSAL: D'oh::Year [was: Re: Making -DPERL_Y2KWARN useful after 946684800]
Message ID:
19991106183930.17486.qmail@plover.com

 On Sun, Oct 31, 1999 at 01:59:41PM -0800, Gurusamy Sarathy wrote:
> IMHO, "20$yr" only has marginal value because that kind of mistake
> will be largely self-correcting and obvious, because people will get
> back "20101" rather than something that is temporarily correct.

Micahel Schwern: 
> Ahh, nature endevors long and hard to produce a better moron!  Expect
> to see this post-y2k:  $year -= 100;  "200$year";   D'oh::Year catches both
> misuses.

I wish I had pointed this out before, but I think Michael is correct
here.  Example: 

	Check if the value returned is greater than 100, and if so,
	subtract 100 from the returned value.  This will always give
	you a one-digit or two-digit number...

That's on page 141 of `Perl for Dummies'.



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