diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-09 17:39:58 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-09 17:39:58 +0000 |
commit | 16fe6d5906f6eff9da00cb861a7054a440d1f6eb (patch) | |
tree | f3ff2ac74f436b26fa347b78d5a7c2cb63206bd6 /pod | |
parent | 023ceb80f0d82032a841fbab1bfd1282af1def7b (diff) | |
download | perl-16fe6d5906f6eff9da00cb861a7054a440d1f6eb.tar.gz |
support binmode(F,":crlf") and use open IN => ":raw", OUT => ":crlf"
semantics; the pragma sets defaults for both open() and qx//
p4raw-id: //depot/perl@5628
Diffstat (limited to 'pod')
-rw-r--r-- | pod/perlfunc.pod | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 650a00a842..2f342900a1 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -443,21 +443,28 @@ L<perlipc/"Sockets: Client/Server Communication">. =item binmode FILEHANDLE -Arranges for FILEHANDLE to be read or written in "binary" mode on -systems where the run-time libraries distinguish between binary and +Arranges for FILEHANDLE to be read or written in "binary" or "text" mode +on systems where the run-time libraries distinguish between binary and text files. If FILEHANDLE is an expression, the value is taken as the -name of the filehandle. binmode() 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. +name of the filehandle. DISCIPLINE can be either of C<":raw"> for +binary mode or C<":crlf"> for "text" mode. If the DISCIPLINE is +omitted, it defaults to C<":raw">. -On many systems binmode() has no effect, and on some systems it is -necessary when you're not working with a text file. For the sake of -portability it is a good idea to always use it when appropriate, and -to never use it when it isn't appropriate. +binmode() should be called after open() but before any I/O is done on +the filehandle. + +On many systems binmode() currently has no effect, but in future, it +will be extended to support user-defined input and output disciplines. +On some systems binmode() is necessary when you're not working with a +text file. For the sake of portability it is a good idea to always use +it when appropriate, and to never use it when it isn't appropriate. In other words: Regardless of platform, use binmode() on binary files, and do not use binmode() on text files. +The C<open> pragma can be used to establish default disciplines. +See L<open>. + The operating system, device drivers, C libraries, and Perl run-time system all work together to let the programmer treat a single character (C<\n>) as the line terminator, irrespective of the external |