#!/usr/bin/env perl use strict; use warnings; my $date_first = '2005-09-27'; my $date_second = '2019-12-22'; my $date_third = '1999-12-22'; use Time::Piece; my $date1 = localtime( $date_first ); my $date2 = localtime( $date_second ); my $date3 = localtime( $date_third ); if( $date2 > $date1 and $date2 > $date3 and $date1 > $date3) { print "correct\n"; }