- or download this
@FullSort = sort {$a->[1] cmp $b->[1]
||
$a->[0] cmp $b->[0]
||
$a->[2] <=> $b->[2]} @data;
- or download this
@data = sort { $a->[0] cmp $b->[0] } @data;
@data = sort { $a->[1] cmp $b->[1] } @data;
@data = sort { $a->[2] <=> $b->[2] } @data;
- or download this
return -1; # moves the item lower
return +1; # goes above the previous one
return 0; # equals
- or download this
my %speeds = (115kbps => 10,
2Mbps => 20,
...
T1 LINE => 40);
my @sorted = sort { $speeds{$a} <=> $speeds{$b} } @unsorted;