push @lists, “5 “;
push @lists, “123 “;
push @lists, “23 “;
push @lists, “2 “;
push @lists, “4 “;
push @lists, “1 “;
print @lists;
print ” “;
print sort @lists;
print ” “;
print reverse sort @lists;
print ” “;
print reverse sort {$a <=> $b}@lists;
結果:
5
123
23
2
4
11
123
2
23
4
55
4
23
2
123
1123
23
5
4
2
1
留言