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

More likely, the OP isn't passing an IO::File.
  • Comment on Re^5: File::Binary and Carriage-Return issue

Replies are listed 'Best First'.
Re^6: File::Binary and Carriage-Return issue
by Corion (Patriarch) on Mar 04, 2009 at 13:20 UTC

    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.