Perl Monk, Perl Meditation | |
PerlMonks |
Re: Determining what line a filehandle is onby wog (Curate) |
on Jul 06, 2001 at 00:06 UTC ( [id://94246]=note: print w/replies, xml ) | Need Help?? |
The $. variable described in perlvar
does exactly this. Or you could keep your own variable
to count lines and increment it yourself.
I hope that you are checking the return value of open in your real code. (e.g. open FILE, "file.txt" or die "opening file.txt for reading: $!\n";).
In Section
Seekers of Perl Wisdom
|
|