my %months = ( 0 => q{Jan}, 1 => q{Feb}, 2 => q{Mar}, 3 => q{Apr}, 4 => q{May}, 5 => q{Jun}, 6 => q{Jul}, 7 => q{Aug}, 8 => q{Sep}, 9 => q{Oct}, 10 => q{Nov}, 11 => q{Dec}, ); my $month = (localtime)[4]; $month --; $month = 11 if $month < 0;