use warnings; use strict; use DateTime; my ($month, $day) = (5, 1); my $now = DateTime->now; my $year = $now->year; my $known_date = DateTime->new( year => $year, month => $month, day => $day, ); if ($now < $known_date) { # do stuff }