Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Grepping a File

by jpeg (Chaplain)
on Apr 16, 2006 at 19:26 UTC ( [id://543686]=note: print w/replies, xml ) Need Help??


in reply to Grepping a File

You're using grep correctly. Your expectations of what it should return are incorrect. When I find my code returning unexpected results, I check perldoc. That would have helped you.

Secondly, I suggest that if you're going to search through the contents of a file, read the lines of the file into an array or use a while loop. I find that I'm iterating over lines of a file much much more than I slurp the contents into a variable.

--
jpg

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-25 16:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found