Actually, on "non broken" platforms, Perl's I/O is more efficient than stdio.h I/O because it knows how to peak inside stdio's internal structures to avoid extra copying of data.
Unfortunately, Linux is a "broken" platform in this regard so Perl's native readline (<>) is 4-times slower than it should be.
I suspect benchmarking this code will show that it is slower than plain <IN> when run on many old-style Unix platforms but faster than <IN> on Linux.
I'd like to encourage effort toward "fixing" Perl's I/O optimizations for Linux and other platforms (written in C).
-
tye
(but my friends call me "Tye")
|