#!/usr/bin/perl use strict; use warnings; use Archive::Zip qw(:ERROR_CODES :CONSTANTS); my $zip = Archive::Zip->new(); my $fileToAdd = '12345678.pdf'; my $viewBillPath = 'a_path'; my $fileWithPath = "$viewBillPath\\$fileToAdd"; $zip->addFile($fileWithPath) or die "couldn't add $viewBillPath\\$fileToAdd\n";