in reply to Finding Line numbers in a file

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