c:\@Work\Perl\monks>perl -wMstrict -MData::Dump -le "my $hashref = { '10857' => [ '10857', 'Test-host1', '192.168.162.124', undef, undef, undef, undef, 'Timeout while connecting to \"192.168.162.124:161\"', ], '10715' => [ '10715', 'Test-Host2', '192.168.162.146', 'checkPing[{HOST.IP}]', '108', '108', '2014-04-01 20:24:01', '', ], '10778' => [ '10778', 'Test-Host3', '192.168.162.144', 'checkPing[{HOST.IP}]', '392', '359', '2014-04-01 20:21:12', '', ], '10582' => [ '10582', 'Test-Host3', '192.168.162.95', 'icmppingsec', '117.390000', '116.493000', '2014-04-01 20:23:03', '', ], }; ;; my @sorted = do { no warnings 'uninitialized'; sort { $a->[4] <=> $b->[4] } values %$hashref; }; ;; dd \@sorted; " [ [ 10857, "Test-host1", "192.168.162.124", undef, undef, undef, undef, "Timeout while connecting to \"192.168.162.124:161\"", ], [ 10715, "Test-Host2", "192.168.162.146", "checkPing[{HOST.IP}]", 108, 108, "2014-04-01 20:24:01", "", ], [ 10582, "Test-Host3", "192.168.162.95", "icmppingsec", "117.390000", "116.493000", "2014-04-01 20:23:03", "", ], [ 10778, "Test-Host3", "192.168.162.144", "checkPing[{HOST.IP}]", 392, 359, "2014-04-01 20:21:12", "", ], ]