in reply to Aes or blowfish file encryption/decryption ?

Try to use binmode on all opened file handles. Something like
use autodie; # to get better and automatic error messages open my $IN, "<:raw", 'filename.zip'; binmode $IN; my $contents = do { local $/; <$IN> }; close $IN; # and then work with $contents

See also: perlopentut, open, PerlIO.

Update: After actually reading PerlIO it seems that :raw and binmode do the same thing, though it can't hurt to test them both together.

Replies are listed 'Best First'.
Re^2: Aes or blowfish file encryption/decryption ?
by ikegami (Patriarch) on Dec 02, 2010 at 20:18 UTC

    :raw and binmode don't do the same thing. :raw will remove buffering while binmode will preserve it.

    open my $IN, "<:raw:perlio", 'filename.zip';
    or
    open my $IN, "<", 'filename.zip'; binmode $IN;