Try replacing your foreach block with
$zip->extractTree();
题
im using perl module to extract a .zip file and it consist of many sub directories and im using the below code
my $extract_path = $des_path . "\\files";
mkdir $extract_path;
my $filename = $des_path . "\\" . basename($zipfile_path);
my $zip = Archive::Zip->new($filename);
foreach my $member ($zip->members)
{
next if $member->isDirectory;
(my $extractName = $member->fileName) =~ s{.*/}{};
$member->extractToFileNamed("$extract_path/$extractName");
}
but my problem is it is place the entire file in a single folder and avoiding the sub folders .That is entire files are placed in a single folder instead of making subfolders
what went wrong any one help me
thanks
解决方案
Try replacing your foreach block with
$zip->extractTree();