in reply to How to get minimum start date in these start dates ?
The idea is simple - the dates can be compared as numbers if they are written in the format YYYMMDD. The sorting can be optimized using the same technique, but you can do it yourself :)my $min; foreach (@dates) { next unless /^(\d+)-(\d+)-(\d+)$/; $min ||= ["$3$2$1", $_]; next unless "$3$2$1" < $min->[0]; $min = ["$3$2$1", $_]; } my $mindate = $min->[1];
|
|---|