my $thismonth = (localtime)[4]; my $lastmonth = ($thismonth == 0)? 11 : $thismonth-1; print $monthname[$lastmonth], "\n";