my @filtered = ( ... )[ -1 ];
Since the @filtered array cannot be more than a single element, wouldn't it be better to make this a scalar?
my $most_recent = ( ... )[ -1 ];
This would have the possibly desirable side effect that if the input array were empty, $most_recent would be undefined/false. (It must be defined/true otherwise because it would be a reference.)
Give a man a fish: <%-{-{-{-<
In reply to Re^2: Get most recent data based on a date from an array of hashes.
by AnomalousMonk
in thread Get most recent data based on a date from an array of hashes.
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |