in reply to I'd use something like this...
in thread Is there an easier way?

# compare ordered date strings my $result = sprintf("%04d%02d%02d",@date_1[2,0,1]) <=> sprintf("%04d%02d%02d",@date_2[2,0,1]); # $result is -1, 0 or 1, so amend for output # to return only 0 or 1; return ($result + $result**2)/2;
Hmm... That's a neat trick with exponentiation to convert -1 to 0, but wouldn't this be much simpler?
# compare ordered date strings return sprintf("%04d%02d%02d",@date_1[2,0,1]) > sprintf("%04d%02d%02d",@date_2[2,0,1]);