Help for this page
while (<FILE>) { if (/foo/) { ... print "$count so far.\n"; } }
while (<FILE>) { while (/foo/g) { ... print "$count so far.\n"; } }
while (<FILE>) { $count++ while /foo/g; } print $count;