Name

binmode

Synopsis

binmode filehandle
                  

Arranges for the file to be treated in binary mode on operating systems that distinguish between binary and text files. It should be called after open but before any I/O is done on the filehandle. The only way to reset binary mode on a filehandle is to reopen the file.

binmode has no effect under Unix, Plan9, or other systems that use a single \n (newline) character as a line delimiter. On systems such as Win32 or MS-DOS, binmode is needed to prevent the translation of the line delimiter characters to and from \n.

Get Perl in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.