Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: localtime $mon
by DamnDirtyApe (Curate) on Jul 16, 2002 at 21:45 UTC

    Simply create an array containing the months in order. You'll be able to reference them as $months[0] through $months[11], so to get the current month you should simply be able to refer to $months[$mon].


    _______________
    D a m n D i r t y A p e
    Home Node | Email
(joshua) Re: localtime $mon
by joshua (Pilgrim) on Jul 16, 2002 at 23:15 UTC
    strftime is your friend.
    #!/usr/bin/perl -w use strict; use POSIX qw|strftime|; my $month = strftime('%B', localtime); print "$month\n";
    Joshua