http://www.perlmonks.org?node_id=986989


in reply to Returning line numbers of a string

In pseudo-code:
open log-file set line-counter to 0 read the log-file a line at a time add one to the line-counter if the pattern is found, then then print "I found pattern at ", line-counter once the file is completely read, close log-file print "We Are Done!!" exit
Let us know when you get stuck implementing this in Perl.

----
I Go Back to Sleep, Now.

OGB