in reply to Finding number of lines in STDIN
(To compare numbers, use '==' not 'eq')last if($. == $number_of_lines);
Note: $. is the line count for the last filehandle accessed, so dont use it if you're accessing other files inbetween.
C.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Finding number of lines in STDIN
by ysth (Canon) on Dec 18, 2003 at 16:32 UTC |