#!/usr/bin/perl use strict; use warnings; use IO::Compress::Zip qw(:all); my $outfile = "test.zip"; my @dirs = ("tc.html", "tc.html.gz"); zip \@dirs => "$outfile", BinModeIn => 0 or die "$!"; print "Done\n";