Carl Jolley wrote:

After all, all binmode is, is a way
to turn off perl's default way of handling the "\r" for you.
It's your way of saying to perl "Thanks, but no thanks for your
offer of assistance, For this file, I can handle this issue without
your help".


While this is true within the context of this discussion (newline conversions), binmode does other things that can also be very important. For instance, I found out several years ago that it was necessary to use binmode when opening some Word97 files in Perl scripts (under Win98), or some of the files would be truncated in the proprietary MS header. As I recall, the specific problem was a \000 byte early in the header that Perl would treat as an eof (unless binmode was in use), but I understand that binmode also turns off Perl's default handling of embedded Ctrl-Z and other control characters.

So I'm not disagreeing with you, but simply pointing out that whenever the input file is in a proprietary format that mixes text with binary segments, binmode is something to think about. At least under Windows, DOS, and related OSs.

And then there's the whole disciplines thing that can be done with binmode (or a 3 argument open). But I don't go there; it is my fervent hope that Perl 6.0 will fix up all that stuff before I have to deal with any multibyte unicode data. :-)

--
Will Woodhull
[EMAIL PROTECTED]


_______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to