zip [$tmpfiles.'/file1.txt',$tmpfiles.'file2.txt'] =>$tmpfiles.'/output.zip', FilterName => sub { s[^.*/][] }; #### use Archive::Zip::SimpleZip qw($SimpleZipError) ; my $z = new Archive::Zip::SimpleZip $tmpfiles.'/output.zip' or die "Cannot create zip file: $SimpleZipError\n" ; # If the data is in a string $z->addString("some text", Name => "file1.txt"); # or if you need carry out more complex processing $fh = $z->openMember(Name => "file3.txt"); print $fh "some data" ; print $fh "some more data" ; close $fh; $z->close();