On Thu, 8 Nov 2012 12:53:31 +0100 Rob Coops <rco...@gmail.com> wrote: > Something like the below would do perfectly fine... > > my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = > localtime(time); > > my @months = ( 'JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', > 'SEP', 'OCT', 'NOV', 'DEC' ); > > my $current_month = $months[$mon]; > my $current_mont_num = $mon; > my $previous_month = $months[$mon -1]; > my $previous_month_num = $mon -1;
You'll have an interesting previous month in January :) -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/