I'd use merlyn's Schwartzian Transform:
chomp ( my @data = <DATA> ); my @sorted = map { $_->[0] } sort { $a->[1] <=> $b->[1] } map [ $_, (split)[3] ], @data; print "$_\n" for @sorted; __DATA__ 0 TOTAL 11997 26981 0 root 1089 2594 1 daemon 0 0 594 pipmp01 591 1151 958 maestro 335 685
Output:
1 daemon 0 0 958 maestro 335 685 594 pipmp01 591 1151 0 root 1089 2594 0 TOTAL 11997 26981
In reply to Re: How can I sort this data on the fourth field?
by FunkyMonk
in thread How can I sort this data on the fourth field?
by country1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |