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

Isn't that backwards? I believe he wants to remove the "added" Carriage Returns, not preserve them.
  • Comment on Re^2: File::Slurp bug? Should I bother?

Replies are listed 'Best First'.
Re^3: File::Slurp bug? Should I bother?
by jmcnamara (Monsignor) on Sep 07, 2005 at 18:24 UTC

    Yes, it is more than a little backwards. Binmodeing the $FILE filehandle gives the same results in both cases.
    ... binmode $FILE; ... __END__ Prints: "Line\r\nLine2\r\nLine3\r\n" "Line\r\nLine2\r\nLine3\r\n" Yep.

    In which case you would also have to binmode the output filehandles in order not to add extra carriage returns!!

    HOWEVER, it doesn't seem right that the carriage returns are in the File::Slurp data without binmode being set. Is this a function of using sysread?

    Can't check at the moment I'll look at it again later.

    --
    John.