in reply to How can I sort this data on the fourth field?

If you can guarantee uniqueness of the field you're sorting on, and if you're going to be manipulating these data by the field itself, sometimes it's useful to use the sorted column as the keys of a hash and drop the rest of the data into the hash as an associative array:

#!/usr/bin/perl use warnings; use strict; package main; my %data_set = (); while(<DATA>) { my @row = split/\s+/, $_; $data_set{$row[3]} = [ $row[0], $row[1], $row[2] ]; } foreach ( sort { $b <=> $a } keys %data_set ) { printf "%-6d -> %-4d %-7s %-6d\n", $_, $data_set{$_}->[0], $data_set{$_}->[1], $data_set{$_}->[2] +; } __DATA__ 0 TOTAL 11997 26981 0 root 1089 2594 1 daemon 0 0 594 pipmp01 591 1151 958 maestro 335 685
The output is:

C:\Code>perl hashsort.pl 26981 -> 0 TOTAL 11997 2594 -> 0 root 1089 1151 -> 594 pipmp01 591 685 -> 958 maestro 335 0 -> 1 daemon 0