in reply to Has a filehandle been binmode'd
my @l = PerlIO::get_layers($fh, details => 1); [download]
Hmm. I knew this too but you were faster.