C: ->Windows ->Desktop ->Carl ->zip ->mysql backup ->sub-folder ->setup.bmp ->setup.exe #### backup ->sub-folder ->setup.bmp ->setup.exe #### #!/usr/bin/perl use strict; use warnings; use Archive::Zip qw/ :ERROR_CODES :CONSTANTS/; use Archive::Zip::Tree; my $dir = 'C:\Windows\Desktop\carl\zip\mysql'; my $file = 'C:\Windows\Desktop\carl\test.zip'; my $name = 'backup'; my $zip = Archive::Zip->new(); $zip->addTree( $dir, $name ) == AZ_OK or die("could not add tree"); $zip->writeToFileNamed( $file ) == AZ_OK or die("could not write file");