my %cache; @sorted = sort { ( $cache{$a} //= 'Time::Piece'->strptime($a->{statement_date}, '%m/%d/%Y') ) <=> ( $cache{$b} //= 'Time::Piece'->strptime($b->{statement_date}, '%m/%d/%Y') ) } @statements;