perl 模块

!/usr/bin/perl 

use List::Util 

####找最大、最小、求和等值

qw/max min sum maxstr minstr shuffle/; 

@a = ('hello', 'ok', 'china', 'unix'); 

print max 1..10; #10 

print min 1..10; #1 

print sum 1..10; #55 

print maxstr @a; #unix 

print minstr @a; #china 

print shuffle 1..10; #radom order

use List::Util qw(first max maxstr min minstr reduce shuffle sum);

 

posted @ 2012-12-13 13:16  蒋蒋  阅读(233)  评论(0编辑  收藏  举报