http://qs1969.pair.com?node_id=11140573


in reply to Get most recent data based on a date from an array of hashes.

One way might be to parse the dates via Time::Piece into a new value into the hashes and then sorting based on that, e.g.

$_->{TimePiece} = Time::Piece->strptime($_->{Date}, '%m-%d-%Y') for @$ +data; my @filtered = sort { $a->{TimePiece} <=> $b->{TimePiece} } @$data;

Fetching the most recent result out of the array and removing the TimePiece key back out of the hash left as an exercise to the reader.