At 3:12 PM -0500 11/20/03, Thomas R Wyant_III wrote: >[EMAIL PROTECTED] wrote: > > >> Since perl 5.6.0 binmode is a noop as it is for Unix. > >Interesting. "$ perldoc -f binmode" and "$perldoc perlvms" seem to me to >say otherwise.
I think he means that on VMS stream-oriented files it is a noop, which is also the case on Unix. That may be true if you don't have any I/O layers applied since it's supposedly equivalent to applying a :crlf layer, but I find the whole binmode business very confusing. It is definitely not deprecated or a noop on Windows and DOS, but there it seems mainly to account for the fact that line endings on stream files are different. It doesn't seem that it was ever meant to do anything special for any of VMS's record-oriented file structures. It is not clear to me whether it was ever intended transparently to switch from using stdio to Unix I/O, which is what one generally does in C to handle binary data. It looks like in Perl, sysread() and syswrite() are the way to access the CRTL's read() and write(). Note that VMS::Stdio::binmode is a different beast. It reopens the file with what boils down to ctx=bin. This causes newlines to be written as literal newline characters rather than generating a new record boundary when write to a record-oriented file. I'm not sure what, if anything, it means on input. >But under 5.6.1 it certainly behaves like a noop. On output >you get "stream_lf" files, so it _would_ be a no-op. It seems to just be >ignored on input, meaning. > >Thanks. Nothing like saying something wrong (or obsolete) to learn. > >So at this point I defer to Craig. I hope I've brought everyone up to my own level of serene confusion :-). It does look like L<perlvms/binmode> is out of date. -- ________________________________________ Craig A. Berry mailto:[EMAIL PROTECTED] "... getting out of a sonnet is much more difficult than getting in." Brad Leithauser
