my $current_month = strftime "%m", localtime; #### my $previous_month = $current_month - 1;