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