Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^4: File::Slurp bug? Should I bother?

by ikegami (Patriarch)
on Sep 07, 2005 at 18:12 UTC ( [id://489957]=note: print w/replies, xml ) Need Help??


in reply to Re^3: File::Slurp bug? Should I bother?
in thread File::Slurp bug? Should I bother?

I just experimented a little using

This is perl, v5.6.1 built for MSWin32-x86-multi-thread
-> sysread convert CRLF to LF.

This is perl, v5.8.0 built for MSWin32-x86-multi-thread
-> sysread does **not** convert CRLF to LF.

Both are ActiveState builds.

Apparently, sysopen/sysread's behaviour changed in 5.8 wrt to CRLF conversion. It used to convert, but now it doesn't. I don't see this mentioned in Perl 5.8's perldelta or anywhere else. It seems to be an (unintentional?) side-effect of switchting to PerlIO.

Replies are listed 'Best First'.
Re^5: File::Slurp bug? Should I bother?
by chester (Hermit) on Sep 07, 2005 at 18:30 UTC
    Ah, it seems to be mentioned for Perl 5.8.1. (Although the text does reference 5.8.0; beats me...)

    "As of the 5.8.0 release, sysopen()/sysread()/syswrite() do not behave like they used to in 5.6.1 and earlier with respect to "text" mode. These built-ins now always operate in "binary" mode (even if sysopen() was passed the O_TEXT flag, or if binmode() was used on the file handle). Note that this issue should only make a difference for disk files, as sockets and pipes have always been in "binary" mode in the Windows port. As this behavior is currently considered a bug, compatible behavior may be re-introduced in a future release. Until then, the use of sysopen(), sysread() and syswrite() is not supported for "text" mode operations.'
    I'm glad to know why it's broken, even if it means no File::Slurp. Thanks for all the help. I wonder if they plan to fix that any time soon. There's a bug report at ActiveState from 2003.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://489957]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-20 00:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found