Perl for foreach while 循环

for

for(my $i=0;$i<10;$i++){
    print $i;
}

 

foreach

foreach my $col_id (sort {$a<=>$b;} keys %col_hash){
    print $col_hash{$col_id};
}

 

 

while

posted @ 2011-12-21 11:25  zjking99  阅读(5497)  评论(0编辑  收藏  举报