Using the Perl IO :: Uncompress :: AnyUncompress Module

I want to use the Perl IO :: Uncompress :: AnyUncompress module, which is described here: http://perldoc.perl.org/IO/Uncompress/AnyUncompress.html .

However, this documentation seems to elude the fact that the compressed archive (.zip, .7z) contains a tree of compressed files. I would like to extract only one file from the archive, and not the full archive, for example:

my $archivename = 'archive.7z';
my $filetoextract = './bin/file.lib';

my $archive = new IO::Uncompress::AnyUncompress($archivename);
my $filecontent = $archive->extract($filetoextract);

However, the API does not seem to have such a extract()fonction, nor a function that would return a list of files contained in the archive.

Did I miss something?

+3
source share
1 answer

IO::Uncompress::AnyUncompressonly works with one compressed byte stream. You will need a module, for example Archive::Any, Archive::Any::Liteor Archive::Libarchive::XS.

+1
source

All Articles