in reply to Re^3: File::Binary and Carriage-Return issue
in thread File::Binary and Carriage-Return issue

Which seems to mean that either IO::File is outdated or a plain call to binmode $fh would suit the same purpose yet not need the fancy OOness.

Replies are listed 'Best First'.
Re^5: File::Binary and Carriage-Return issue
by ikegami (Patriarch) on Mar 04, 2009 at 13:15 UTC
    More likely, the OP isn't passing an IO::File.

      You're right. A plain filehandle (as likely opened by File::Binary) is an IO::Handle object. And these don't know about the ->binmode method:

      Q:\>perl -le "open my $fh, $^X or die $!; $fh->binmode" Can't locate object method "binmode" via package "IO::Handle" at -e li +ne 1.

      So the easiest fix approach would be to use File::HandleIO::File objects instead of filenames, but I haven't looked at what API File::Binary uses. It could also make sense to patch File::Binary to use files (as the module name implies).

        So the easiest fix approach would be to use File::Handle objects instead of filenames

        uh? It works when you pass a file name. It creates an IO::File object, and they do have binmode.

        And did you mean FileHandle? It's been renamed to IO::File. Use the latter instead.