I'm sure it can be done more succinctly, but this should make obvious what is going on.my $cnt=0; while (my $line = <>) { $cnt++ if $line =~ /formulae/; last if $cnt>1; } if ($cnt>1) { # got what we wanted } else { # word didn't appear twice }
In reply to Re: Finding the second line an item appears on
by dreadpiratepeter
in thread Finding the second line an item appears on
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |