in reply to Date calculations in Perl for Win32

Date::Calc and Date::Manip are both available from the ActiveState PPM Repository. I'd seriously suggest that your client install these.

If that's absolutely positively impossible, then you're stuck with something like the following:

my $day = (localtime())[7]; my $week_num = int($day/7) + 1;
Come to think of it, that's not so bad after all.

Replies are listed 'Best First'.
RE: Re: Date calculations in Perl for Win32
by davorg (Chancellor) on Aug 30, 2000 at 13:29 UTC

    If you read the docs for Date::Manip, you'll see that even the author admits that it's a very large and slow module. The only time that I'd consider using it would be to parse date strings. For most other date calculations the standard Perl functions are much more efficient (like chromatic's Week number example above.

    --
    <http://www.dave.org.uk>

    European Perl Conference - Sept 22/24 2000, ICA, London
    <http://www.yapc.org/Europe/>
RE: Re: Date calculations in Perl for Win32
by PotPieMan (Hermit) on Aug 30, 2000 at 05:11 UTC

    Good point. It's strange that the Date::Calc and Date::Manip modules are included in the ActiveState Perl documentation (generated by pod2html, obviously) and the PPM Repository, but not in the standard distribution.

    Anybody know why ActiveState didn't include these modules with the standard distribution? They wouldn't have added much to the size.

    -ppm

      Because those modules aren't part of the standard distribution on any platform. As far as I know, the only non-standard modules that ActiveState have added to their distribution are the ones which are necessary in order to use ppm - i.e. the LWP bundle.

      --
      <http://www.dave.org.uk>

      European Perl Conference - Sept 22/24 2000, ICA, London
      <http://www.yapc.org/Europe/>
        And in 5.6 the MySQL DBD's...I believe these aren't part of the standard distribution either...

        Jouke Visser, Perl 'Adept'