So I think I have it.

In my case, there are two Zip files, some folders are removed from one and some from the other. In any event, the scheme outlined above seems to work.

A code snippet:
: : $csv = Text::CSV->new(); $TodoCnt = -1; PROC_TODO: while(my $TODOrec = <TODO>) { # . . . . . . . . . . . . . . . . . . . +. . . . . $TodoCnt++; if ($TodoCnt == 0) {next PROC_TODO;} if ($TODOrec =~ /^FNX,/i) {last PROC_TODO;} $csv->parse($TODOrec); @Fields = $csv->fields(); DELETE_EACH_FILE: foreach my $FileNameToDelete (@InDirFiles) { # . . . . . . . . . . . + . . . . . $NewMemberName = $Fields[FLD_LECROY] . "/" . $FileNameToDelete; print "DBG: Name- \"$NewMemberName\"\n"; if (defined($zipB->memberNamed($NewMemberName))) { print "DBG: Member exists (ZipB) (\"$NewMemberName\")\n"; } else { die "**Fatal error, can't find in zip (ZipB; \"".$NewMemberNam +e."\")"; } if (defined($zipA->memberNamed($NewMemberName))) { print "DBG: Member exists (ZipA) (\"$NewMemberName\")\n"; } else { die "**Fatal error, can't find in zip (ZipA; \"".$NewMemberNam +e."\")"; } printf(LOGALL "%.4d Folder: \"%s\"\n", $TodoCnt, $Fields[FLD_LECR +OY]); printf(LOGALL "%.4s \"%s\"\n", " ", $Fields[FLD_BY_T +DS]); printf(LOGALL "%.4s \"%s\"\n", " ", $FileNameToDelet +e); if ($Fields[FLD_MOVE] =~ /^\s*$/) { print LOGALL " skip folder from ZIP_A_New\n"; print LOGALL " delete folder from ZIP_B_Append\n"; $DelBcnt++; if (!defined($zipB->removeMember($NewMemberName))) { die "**Fatal error, can't remove (ZipB; \"".$NewMemberName." +\")"; } } elsif ($Fields[FLD_MOVE] =~ /^move to B$/i) { print LOGALL " delete folder from ZIP_A_New\n"; print LOGALL " SKIP folder from ZIP_B_Append\n"; $DelAcnt++; if (!defined($zipA->removeMember($NewMemberName))) { die "**Fatal error, can't remove (ZipA; \"".$NewMemberName." +\")"; } } else { die "**Fatal error, Unknown \"move\" (\"".$Fields[FLD_MOVE]."\ +")"; } } # . . . . . . . . . . . . . . . . . . . . . . . . . . end DELETE +_EACH_FILE } # . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . end + PROC_TODO if ($Stat = $zipA->overwrite() != AZ_OK) { printf("\n**Error, bad Zip A overwrite() (code: %d)\n\n", $Stat); } if ($Stat = $zipB->overwrite() != AZ_OK) { printf("\n**Error, bad Zip B overwrite() (code: %d)\n\n", $Stat); } : :

Sorry for the screwy code, but I have been trying different approaches and, someday, I'll clean it up.

I just hope it helps someone else...

Thanks,
  EigenFunctions
  OpSys: Win7 x64 Service Pack 1 Professional/Home Premium Perl: Strawberry (v5.22.0)/ActiveState (v5.14.2)


In reply to Re^5: Remove an existing, non-empty, directory re: Archive::Zip by EigenFunctions
in thread Remove an existing, non-empty, directory re: Archive::Zip by EigenFunctions

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.