예)
문자열 배열
"A 0.4 B"
"A 0.123 C"
...
문자열 배열
"A 0.4 B"
"A 0.123 C"
...
두 번째 탭의 숫자 크기 순으로 정렬하고자 할 때.
@result_list = sort {
my @tempA = split/ /,$a;
my @tempB = split/ /,$b;
$tempB[1] <=> $tempA[1]
} @result_list;
my @tempA = split/ /,$a;
my @tempB = split/ /,$b;
$tempB[1] <=> $tempA[1]
} @result_list;
Show Comments