an important difference between while and foreach on Perl

while (<STDIN>) { } # will read from standard input one line at a time

foreach (<STDIN>) { } # will read everything from standard input before looping
posted @ 2015-12-07 11:03  liuhui_pine  阅读(116)  评论(0)    收藏  举报