Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^3: File::Binary and Carriage-Return issue

by Anonymous Monk
on Mar 04, 2009 at 12:57 UTC ( [id://748122]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-04-25 19:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found