Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^2: Get most recent data based on a date from an array of hashes.by AnomalousMonk (Archbishop) |
on Jan 19, 2022 at 21:38 UTC ( [id://11140622]=note: print w/replies, xml ) | Need Help?? |
my @filtered = ( ... )[ -1 ];
Since the @filtered array cannot be more than a single element, wouldn't it be better to make this a scalar? 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 Section
Seekers of Perl Wisdom
|
|