use Time::Piece; my $t = Time::Piece->strptime("31-01-200", "%d-%m-%Y"); $t1 = Time::Piece->strptime("31-01-2005", "%d-%m-%Y"); if($t1 > $t){ print "To be or not to be."; }