use Archive::Zip qw(:ERROR_CODES :CONSTATS); 1. $zip = $ENV{TMPDIR}= '/homepages'; 2. $ENV{TMPDIR}='/homepages'; 3. $zip{TMPDIR}='/homepages'; my $zip = archive::zip->new(); $zip->addTree("/hompages/....", "backup"); $zip->overwriteAs("/homepages/..");