Perl Monk, Perl Meditation | |
PerlMonks |
Re: Line number in a fileby murugu (Curate) |
on Jul 06, 2004 at 10:28 UTC ( [id://372058]=note: print w/replies, xml ) | Need Help?? |
if $/(input record separator) is '\n', use $. which is used to get the current line number. for ur problem, use $` and count the number of \n which yields the line number.(But using $` makes program run slow) cheers
In Section
Seekers of Perl Wisdom
|
|