sub isGreater{ my $currDate = shift; my $oldDate = shift; my ($currMonth,$currDay,$currYear) = split /\//,$currDate; my ($oldMonth,$oldDay,$oldYear) = split /\//,$oldDate; return $currYear <=> $oldYear or $currMonth <=> $oldMonth or $currDay <=> $oldDay; }