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

[MacPerl] problem using localtime in macperl 5.x



Hello,


        The following fragment seems to run fine on my Sun workstation
        running perl 4.x or 5.x. It used to work nicely under macperl
        4.x. However with perl 5.1.1r2 it fails. ($time=-1). Am I missing
        something or is this a bug in the mac version of perl?

#! /usr/local/bin/perl
require "timelocal.pl";

        # first set through the days of the year
        $time=&timelocal(0,0,0,1,0,97);
        ($sec,$min,$hr,$dd,$mm,$yy,$wday,$yday,$dlst)=localtime($time);

        print "$time\n";
        print "$sec,$min,$hr,$dd,$mm,$yy,$wday,$yday,$dlst\n";


======================================================================
Fergus McMenemie               Email:fergus@twig.demon.co.uk.
Technical Basis                Phone:0421 376 021

Unix/Mac/Intranets             Analyst Programmer
======================================================================