das hier geht! hab getestet!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use Archive::Zip;
use strict;
my $log_dest = "C:\\TEMP\\ZIP";
my $zip = Archive::Zip->new();
chdir $log_dest or die "chdir $log_dest: $!";
opendir(DIR,$log_dest) or die "Can't open the current Directory: $!\n";
my @names = readdir(DIR) or die "Unable to read current dir:$!\n";
foreach my $fileName (@names) {
if ($fileName =~ /.LOG/) {
$zip->addFile($fileName);
}
}
my $zip_name = "test.zip";
print "\nZipping Files to $zip_name\n\n";
$zip->writeToFileNamed("$zip_name");