http://www.perlmonks.org?node_id=396828


in reply to Re^2: Distinguishing text from binary data
in thread Distinguishing text from binary data

Those tests work on filehandles too, so if you have a socket, that should work.

perldoc -f -X says it reads the current buffer for FHs, and the first block for files.

-nuffin
zz zZ Z Z #!perl