You can access the line count for any filehandle with some_filehandle->input_line_number (but you have to use FileHandle or use IO::Handle first).
Note that STDIN->input_line_number is tracked separately from ARGV->input_line_number even when <ARGV> or empty <> is reading from stdin.
In reply to Re: Re: Finding number of lines in STDIN
by ysth
in thread Finding number of lines in STDIN
by bonoboy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |