Perl Learning - 8 (I/O, <>, print(), @ARGV)
foreach(){ # list context print "I saw $_";}
while() is scalar context, once it gets one line the line be will be printed. Then gets another line, one line a time.
foreach() is list context, so it will gets all lines at a time, then print one line at a time going through elements.
页:
[1]