Chinaunix首页 | 论坛 | 博客
  • 博客访问: 226438
  • 博文数量: 50
  • 博客积分: 1415
  • 博客等级: 上尉
  • 技术积分: 541
  • 用 户 组: 普通用户
  • 注册时间: 2009-12-03 11:48
文章分类

全部博文(50)

文章存档

2010年(38)

2009年(12)

我的朋友

分类:

2009-12-09 15:41:27

#!user/bin/perl

use strict;

##二维数组排序

my @list=(
                ["1","3a","hh"],
                ["2","4","gg"],
                ["2g","4","ff"],
                ["2g1","4","ff"],
                ["12","2","aa"],
                ["12g","2","bb"],
                ["12g1","2","cc"],
                ["12g2","2","dd"],
                ["12g11","2","ee"],
                ["121","2as","ee"],
                ["122","as2as","asee"],
           );
        
my @array = sort{$a->[1] <=> $b->[1]} @list;
foreach (0..$#array){

print join " ", @{$array[$_]},"\n";
}


阅读(1826) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~