open my $ZIP, '+<', 'test.zip'; local $/ = undef; my $data = <$ZIP>; my @offset; while ($data =~ /PK\x03\x04/g) { # find all file headers push @offset, pos($data) - 4; } print "Found headers at: @offset\n"; substr($data, $offset[1]+14, 1) ^= "\x01"; # change the crc seek $ZIP, 0, 0; print $ZIP $data;