Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: Grepping a Fileby jpeg (Chaplain) |
on Apr 16, 2006 at 19:26 UTC ( [id://543686]=note: print w/replies, xml ) | Need Help?? |
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
In Section
Seekers of Perl Wisdom
|
|