I'd have thought that writing to a file and reading it back would have slowed me down, but it didn't! I'm currently running over a fairly small'ish set of data ($file = approx.100Mb, and $tmpfile = 50Kb).Yes, it is quite probably slowing you down a very little bit. (Although I am not entirely sure that Linux isn't writing some data to a temporary file during the process, but let's assume it doesn't, that does not change the reasoning here anyway.)
You're speaking about reading a 100 MB file in both cases. And also writing and reading a file 2,000 times smaller ($tmpfile = 50Kb) in one of the cases and not in the other case. I would think that these later operations are completely negligible compared to the time needed to read the original file. Even with the best benchmarking tools on a machine completely dedicated for those tests and doing absolutely nothing else, there is no way you can make sense of a 0.1% difference in execution time.
In reply to Re: search/grep perl/*nix
by Laurent_R
in thread search/grep perl/*nix
by Gtforce
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |