- or download this
my @dates = qw( 2001-12-24 1999-03-2 2004-04-23 );
print join(', ', sort { $b cmp $a } @dates );
- or download this
2004-04-23, 2001-12-24, 1999-03-2
- or download this
sort { $a->{date} cmp $b->{date} } @$array
- or download this
grep { $_->{date} ge $today } ...
- or download this
( ... )[0]->{isnext} = 1;
- or download this
(grep {$_->{date} ge $today} sort {$a->{date}cmp $b->{date} } @$array)
+[0]->{isnext} = 1;
- or download this
my $today = '2001-03-28';
my $array = [
...
# alternatively :
my $thenext = (grep { $_->{date} ge $today } sort { $a->{date} cmp $b-
+>{date} } @$array)[0];
print "\nThe next date is: $thenext->{date}\n";