It is zipping all of them into just one file and I know it must be something simple that I am missing.
#!/usr/bin/perl use IO::Compress::Zip qw(:all); $path='/DATA/DOCUMENTS/'; opendir my $dh, $path; my @files = readdir $dh; foreach my $files (@files){ print "$files\n"; $zipfilename=substr($files,7); $zipfilename1=$path.$zipfilename; zip [ glob("$zipfilename1*.pdf") ] => "$zipfilename1.zip" or die "Cannot create zip file: $ZipError" ; } closedir $dh;
In reply to Zipping the contents of a directory by filename by justin423
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |