you can make your own counter something like
my $counter; while ( <$fh> ) { $counter++; print "Line number is : $counter\n"; }
or you could just use $. which detects line number automatically when reading from file handle
while ( <$fh> ) { print "Line number is :" . $. . "\n"; }
HTH
In reply to Re: Finding Line numbers in a file
by ahmad
in thread Finding Line numbers in a file
by sanPerl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |