use Data::Dumper; use strict; my @arr; while (<DATA>) { s/\s+$//; push @arr, [split /\s+/, $_] if $_; } print Dumper(\@arr); @arr = sort { $b->[2] <=> $a->[2] } @arr; print Dumper(\@arr); __DATA__ A BBL 0.2 B BBH 0.3 C BB 0.1
In reply to Re: create 2-D array and then sort from max. to min.
by TedPride
in thread create 2-D array and then sort from max. to min.
by 3dog
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |