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

http://cpansearch.perl.org/src/SIMONW/File-Binary-1.7/lib/File/Binary.pm     $fh->binmode if $fh->can('binmode');

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

    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.

      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).

Re^4: File::Binary and Carriage-Return issue
by mickeyn (Priest) on Mar 04, 2009 at 13:06 UTC
    Thanks,
    I did see this line, but it obviously didn't do what it should have, considering my above solution did the trick.

    Mickey