in reply to Array of Hashes

For code like:

if ($val > $max) { $max = $val; }

modifiers are your friend. Try this instead:

$max = $val if $val > $max;

Perl is Huffman encoded by design.