[svn:perlfaq] r6751 - perlfaq/trunk

[email protected] Sat, 5 Aug 2006 17:46:41 -0700 (PDT)
Newsgroups perl.cvs.perlfaq
Message-ID <[email protected]>
Author: comdog
Date: Sat Aug  5 17:46:40 2006
New Revision: 6751

Modified:
   perlfaq/trunk/perlfaq4.pod

Log:
* How do I handle binary data correctly?

	+ removed unix bigotry



Modified: perlfaq/trunk/perlfaq4.pod
==============================================================================
--- perlfaq/trunk/perlfaq4.pod	(original)
+++ perlfaq/trunk/perlfaq4.pod	Sat Aug  5 17:46:40 2006
@@ -2073,19 +2073,14 @@
 
 =head2 How do I handle binary data correctly?
 
-Perl is binary clean, so this shouldn't be a problem.  For example,
-this works fine (assuming the files are found):
+Perl is binary clean, so it can handle binary data just fine.
+On Windows or DOS, however, you have to use C<binmode> for binary 
+files to avoid conversions for line endings. In general, you should
+use C<binmode> any time you want to work with binary data.
 
-	if (`cat /vmunix` =~ /gzip/) {
-		print "Your kernel is GNU-zip enabled!\n";
-		}
-
-On less elegant (read: Byzantine) systems, however, you have
-to play tedious games with "text" versus "binary" files.  See
-L<perlfunc/"binmode"> or L<perlopentut>.
-
-If you're concerned about 8-bit ASCII data, then see L<perllocale>.
+Also see L<perlfunc/"binmode"> or L<perlopentut>.
 
+If you're concerned about 8-bit textual data then see L<perllocale>.
 If you want to deal with multibyte characters, however, there are
 some gotchas.  See the section on Regular Expressions.