This is equivalent to while(<>) { ... }
use strict; use warnings; open my $fh, "test.txt" or die $!; foreach (;<$fh>;){ print " $. :$_ \n"; }
In reply to Re: Line number problem with foreach
by dharanivasan
in thread Line number problem with foreach
by vinoth.ree
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |