in reply to Re: How to sort array by columns maintaining the rows? (for C style arrays)
in thread How to sort array by columns maintaining the rows? (for C style arrays)
Second, to sort your line speeds, create a hash that converts the names to sortable numbers:
Now, you can sort line speeds. Suppose that your list @connections contains records with the line speed in the first element (index 0). Thus,my $n=1; for (qw(115kbps 2Mbps 10Mbps T1)) {$order{$_}=$n++}
@result= sort {$order{$a->[0]} <=> $order{$b->[0]}} @connections;
|
---|