Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Perl Programming/Keywords/binmode

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

Perl bind bless Keywords The binmode keyword The binmode function sets that FILEHANDLE is read or written in "binary" or "text" mode on systems where the run-time libraries distinguish such file types. If FILEHANDLE is an expression, its value is taken as FILEHANDLE name. The function returns true on success and undef otherwise, setting $! (errno). It is good programming practice to use it where appropriate and never to use it otherwise, as a missing call will result in errors on operating systems like DOS or Windows that differentiate such file types. If LAYER is present, it is a single string that may contain multiple directives, which alter the behaviour of the FILEHANDLE. With LAYER, using binmode on a text file makes sense. Without LAYER or specified as :raw, the filehandle is made suitable for passing binary data. This includes turning off possible CRLF translation and as opposed to Unicode characters, marking it as bytes. Syntax binmode FILEHANDLE, LAYER binmode FILEHANDLE Perl bind bless Keywords