(Cross-posted to perl)
be IO Barbie reading is HARD!
Read this thread from the archive of the perl5-porters mailing list to see how hard it is.
Enjoy the subtle and often incomprehensible distinctions between blocking, buffering, and other concepts, and how they play along with Perl's read() and sysread() commands, C's read(2) and fread(3) calls, PerlIO, sockets-vs-regular-files, and more.
My brane hurts.