[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Perl localtime() Problems [was Re: *ping*]



>   In all fairness to Matt and others of us who have been using Perl for a
>   while, the Version 4 documentation is somewhat to blame:

>o  It doesn't explicitly describe what's returned for the year.
>   (The Version 5 document says "the year has had 1,900 subtracted from it")

The perl4 manpage reads:

    All array elements are numeric, and come straight out of a struct tm.

The Perl manpages of old did not try to reproduce the entire
section 3 manpages on their own.  The localtime(3) manpage
was essential for learning what those values that
came straight out of a struct tm were.


>o  Examples show the following use pattern:

>	($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)
>		= localtime(time);
>	$month = (January,February,March,April,May,June,
>		July,August,September,October,November,December)[$mon];
>	 . . . "$month $mday, 19$year" . . .

No such examples occur in the perl4 manpage.   Where did you
get that from?

That doesn't mean no such bugs existed in code, including some very old
perl tools.  But the documentation never suggested that you do that.

--tom