use POSIX qw(strftime); my $month = strftime "%Y-%m", localtime;