use Archive::Zip; $path = $ARGV[0]; chdir ($path); my $zip = Archive::Zip->new(); #create object my $file = $1 if($path =~ /\\([^\\]+)$/); $zip->addTree( '.', "$file" ); $zip->writeToFileNamed( "$path.zip" ); #archive & compress print "Zip Process Over";