All pastes #1179 Raw Edit

Anonymous

public text v1 · immutable
#1179 ·published 2004-09-29 23:59 UTC
rendered paste body
sub unzipScalar {
    my $filename = shift;
    my $SH       = shift;
    my $zip = Archive::Zip->new();
    $zip->readFromFileHandle( $SH );
    return $zip->contents($filename);
}

# caller:
        my $content = getFile ($ua, $fileURI);
        my $tfh = IO::File->new_tmpfile
                or die "Unable to make new temporary file: $!";
        $tfh->print ($content);
        $tfh->seek (0, 0);
        my $unzipped = unzipScalar ($filename,$tfh);