Hello all and thank you for your kind replies!
I actually meant an all-against-all comparison, but I think I will go for something like this:
#!/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";
}
since I just needed to only compare between them and not calculate days. This works for me now, thanks again!