use strict; my $output = <[3] cmp $b->[3] || $a->[1] <=> $b->[1]} @data) { print "Error ID: $rec->[0] Time: $rec->[1]\n"; }