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."; } #### Day too big - 47512 > 24855 Sec too small - 47512 < 74752 Sec too big - 47512 > 11647 Cannot handle date (0, 0, 0, 31, 0, 2100) at /usr/lib/i686-linux/Time/Piece.pm line 288