Your script (slightly modified) works for me:

use strict; use Archive::Zip qw(:CONSTANTS :ERROR_CODES); use File::Temp; warn "Using Archive::Zip $Archive::Zip::VERSION"; my $tmp = $ENV{'TEMP'}.'/zip/extractMember'; my $zip = Archive::Zip->new(); if ($zip->read('tmp2.zip') != AZ_OK) { die 'Einlesen klappt nicht.'; } foreach my $member ($zip->members()) { print($member->fileName()."\n"); my $target = File::Temp::tempnam($tmp, 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX +XXXX'); print "First"; $member->extractToFileNamed($target); print "\n"; print "Second"; $target = File::Temp::tempnam($tmp, 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +X'); $member->extractToFileNamed($target); print "\n"; } __END__ Using Archive::Zip 1.23 at tmp.pl line 5. tmp2.txt First Second

Note that I'm using an older version of Archive::Zip here. I also don't get the warning about the CRC32 mismatch:

format error: CRC or size mismatch while skipping data descriptor at C:/Programme/Perl/lib/Archive/Zip/ZipFileMember.pm line 189

Are you sure that your archive is OK? I created my test archive using 7zip.

I'll be upgrading to Archive::Zip 1.30 and retest.

Update: Upgraded to Archive::Zip 1.30 and it still works for me:

Using Archive::Zip 1.30 at tmp.pl line 5. tmp2.txt First Second

My guess is that your zip file is broken.


In reply to Re^2: unable to extract same file twice using Archive::Zip by Corion
in thread unable to extract same file twice using Archive::Zip by Pickwick

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.