Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

by ikegami (Patriarch)
on Mar 04, 2009 at 13:15 UTC ( [id://748134]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (2)
As of 2024-04-26 01:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found