in reply to Has a filehandle been binmode'd
Hmmm ... well you could try Fcntl; however, it may not be supported on your platform:
!#/usr/bin/perl use Fcntl; open( FH, "<", "/bin/cat" ) or die "cannot open file: $!\n"; $flags = fcntl(FH, F_GETFL, 0) or die "Can't get flags for the file: $ +!\n"; if( $flags | O_BINARY ) { print "OPEN FOR BINARY\n" }
|
|---|