From: "Vinayak dutt" <[EMAIL PROTECTED]>
Am vinayak here.
As am new to Perl and their is a requirment which says -
1. There exists a .zip which contains folders and file.

2. Search for 'makefile' in the respective folders and store them in a text
file.

3. And search for .c files in them and list them in separate text file.
4. Then the files that exists other than .c files should be removed from the
dir.

From which dir? You only have files in a zip archive.

Here is a perl program that reads a zip archive, extracts the makefile and .c files, then delete the other files from the archive (if this is what you wanted to say by "from the dir").

Octavian

use strict;
use Archive::zip;

my $zip = Archive::Zip->new('lucru.zip');

my @files = $zip->memberNames;

foreach my $file(@files) {
if ($file eq 'makefile' or $file =~ /\.c$/) {
$zip->extractMember($file);
}
else {
$zip->removeMember($file);
}
}

$zip->overwrite;


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to