Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Returning line numbers of a string

by Old_Gray_Bear (Bishop)
on Aug 12, 2012 at 22:47 UTC ( #986989=note: print w/ replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://986989]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2016-06-24 23:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (322 votes). Check out past polls.