in reply to Performance Question

The C function is called setvbuf, which will redefine how buffered data is read. For C programs, this can be a lifesaver. Give it a 1MB buffer and the OS can fetch a lot more data in a given read.

See the IO::Handle setvbuf function, which should be documented on that page, complete with an example. The on-line docs seem to differ (i.e. are busted) compared to the real ones that ship with 5.6.1.