in reply to Re: attachment logging
in thread attachment logging

Of course, this is just a band-aid, as binmode actually does something, nowadays even on systems with unixish file semantics. Most likely, the proper fix would be to upgrade IO::File to a later version than is installed, or to copy the code for IO::File::binmode into that subroutine:

sub binmode { ( @_ == 1 or @_ == 2 ) or croak 'usage $fh->binmode([LAYER])'; my($fh, $layer) = @_; return binmode $$fh unless $layer; return binmode $$fh, $layer; }

Replies are listed 'Best First'.
Re^3: attachment logging
by Bass-Fighter (Beadle) on Dec 18, 2008 at 12:30 UTC
    and where in my code must I set this?, srry, I'm still a rooky in perl. just 3 weeks of experience with this...

      Corion's suggestion of adding the "binmode" sub to your code is not unreasonable, but if you're new to Perl, the simplest answer for you is just to update the IO::File module. If you've never done that, modern Perls provide a script that makes it easy - it's called 'cpan'. Assuming that you're on some sort of *nix (rather than Windows) and that you have access to root privieleges, all you need to do is run 'cpan' as root at your command line, and follow the setup prompts; once you're done with the setup, just type 'install IO::File' and that'll take care of it.

      Just for completeness' sake - on older versions of Perl, where there's no "cpan" script, you'd type "perl -MCPAN -eshell" (again, as root) to do essentially the same thing. This also works on modern versions.


      --
      "Language shapes the way we think, and determines what we can think about."
      -- B. L. Whorf
        okee I got it. it works:D I want to thank you all very much:D