in reply to Re: Get most recent data based on a date from an array of hashes.
in thread Get most recent data based on a date from an array of hashes.
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: <%-{-{-{-<
|
---|