Problems? Is your data what you think it is? | |
PerlMonks |
Re^4: Searching text filesby aquarium (Curate) |
on Sep 16, 2006 at 14:05 UTC ( [id://573335]=note: print w/replies, xml ) | Need Help?? |
forget O(n) etc. the original poster was slurping the whole files into memory, which was the cause of the slowness. grep will match the number in the 3 files (several megs total) in about a second....which surely meets the criteria for response time. the poster is a beginner, so would be best for them to have a one liner with a 1 second response time..rather than complicated code with at best 0.5 second response time.
the hardest line to type correctly is: stty erase ^H
In Section
Seekers of Perl Wisdom
|
|