in reply to Is there an easier way?
Keeping in line with your basic logic I'd probably parse as follows:
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 $currDa +y <=> $oldDay; }
|
|---|