foreach my $dir (@dirs) {
@files = glob "*.eap";
my $mkvingestzip = Archive::Zip->new();
foreach $_ (@files) {
$mkvingestzip->addFile($_);
}
I think that your problem here is that you are performing the glob in the $CWD which is not $dir and therefore it isn't matching. You could confirm this by adding diagnostic print statements like this:
foreach my $dir (@dirs) {
print "Now processing dir $dir\n";
@files = glob "*.eap";
my $mkvingestzip = Archive::Zip->new();
foreach $_ (@files) {
print "Adding file $_\n";
$mkvingestzip->addFile($_);
}
You will likely see the "dir" diagnostics but no "file" ones. In that case you'll need either to chdir inside the outer loop or else prepend the path to the glob argument.
Printing diagnostics like this is item number 2 on the Basic debugging checklist.