Perl中跳出循环

From Yefu's notes
Jump to: navigation, search
while(<STDIN>){
  if(/_ _ END_ _/){
     #这个标记之后不会有其它输入了
     last;
  }elsif(/fred/){
     print;
  }
}

<comments/>