sub _open_sxc_fh($self, $fh, $member, %options) { my $zip = Archive::Zip->new(); my $status = $zip->readFromFileHandle($fh); $status == AZ_OK or croak "Read error from zip"; my $content = $zip->memberNamed($member); if( ! defined $content ) { if( $options{ optional }) { return; } else { croak "Want to read $member' but it doesn't exist!"; } } $content->rewindData(); my $stream = $content->fh; 1 if eof($stream); # reset eof state of $stream?! Is that a bug? Where? binmode $stream => ':gzip(none)'; return $stream }