Thank you for your reply.
You're right. But
@files = $zip->memberNames();
does exactly what I want. I have all the file names and paths in the array.
And with:
@file = splice @files, 1, 50;
I reduce the information before it's written to an archive.
I want to select before I write and have the names, that's why comparing is not my goal.
It's curious why
foreach $line (@file) {
$fileend = (split(/\./,"$line"))[-1];
if (($fileend eq "jpg") || ($fileend eq "txt")) {
$zip->addFile("$line");
}
doesn't do the job. Any explanation to this? |