程嶏清单9-3.txt

来自「< linux网络编程工具>>配套源码」· 文本 代码 · 共 22 行

TXT
22
字号
sub bigger_than {
    my($n,@values);           # create some local variables
    ($n,@values) = @_;        # split args into limit and values
    my(@result); # temporary for holding the return value
    foreach $_ (@values) {    # step through the arg list
       if ($_ > $n) {        # is it eligible?
           push(@result,$_); # add it
       }
    }
return @result;                  
}
@list = (95..105);
@new = bigger_than(100,@list);     
foreach $number(@new){
print $number," ";
}
print "\n";
@this = bigger_than(5,1,5,122,-34.15,30,780);  
foreach $number(@this){
print $number," ";
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?