my $max = 10; my $num = 0; my @lines; while (<STDIN>) { last if ++$num > $max; push @lines, $_; }
In reply to Re: Re: Finding number of lines in STDIN
by CombatSquirrel
in thread Finding number of lines in STDIN
by bonoboy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |