Thanks to my old friend billtcat back in '97, I've picked up a naughty perl trick I can't seem to shake.
@array = `cat filename`; #opening filehandles is too much work!
But that is a system call!! GASP that must REALLY slow things down! Ah, but does it? I decided to find out, here are the benchmark results of the program i wrote to test this
So, in order to actually benchmark this i had to run the commands a few times each (for example, cat_file was run 142 times a second for 30seconds!)
In the time it took me to cat a file 4260 times i could have opened 4680 files!
I think i'm going to keep using cat to read in single files :D
Here are some more runs with 10MB and 100MB files. I tried to test 1000MB but i ran out of memory :D