CPANPL...xtract(3pm)
π CPANPLUS::Internals::Extract π
okay bestie so this is CPANPLUS::Internals::Extract β the internals girlie for archive extraction, living her best life in the User Contributed Perl Documentation section. she's a 3pm page, she's internal, and she is so good at her job. π
β¨ NAME β¨
CPANPLUS::Internals::Extract β the internals for archive extraction, no cap π¦
πΈ SYNOPSIS πΈ
### for source files ###
$self->_gunzip( file => 'foo.gz', output => 'blah.txt' );
### for modules/packages ###
$dir = $self->_extract( module => $modobj,
extractdir => '/some/where' );
like, that's the whole vibe. two modes, both iconic. π
π«Ά DESCRIPTION π«Ά
CPANPLUS::Internals::Extract extracts compressed files for CPANPLUS. she can do this either with a pure perl solution β which is the preferred one, periodt β using Archive::Tar and Compress::Zlib, or with binaries, like gzip and tar. so you've got options, bestie, and she's not gonna judge you for picking either. π
the flow looks like this:
$cb->_extract
Delegate to Archive::Extract
like literally that's it, she just hands it off. delegation queen. π
π METHODS π
$dir = _extract( module => $modobj, [perl => '/path/to/perl', extractdir => '/path/to/extract/to', prefer_bin => BOOL, verbose => BOOL, force => BOOL] )
so _extract will take a module object and extract it to extractdir if that's provided, or to the default location, which is obtained from your config. she's flexible like that. π§
the file name is obtained by looking at $modobj->status->fetch, and then it gets parsed to see if it's a tar or a zip archive. detective work, honestly.
if it's a zip archive, __unzip will be called; otherwise __untar will be called. and in the unlikely event the file is of neither format, an error will be thrown. π like she will not be guessing, she will be throwing hands (an error).
_extract takes the following options:
moduleβ aCPANPLUS::Moduleobject. this one is required, so don't come empty-handed. π«Άextractdirβ the directory to extract the archive to. by default this looks something like:
/CPANPLUS_BASE/PERL_VERSION/BUILD/MODULE_NAME
prefer_binβ a flag indicating whether you prefer a pure perl solution, ieArchive::TarorArchive::Ziprespectively, or a binary solution likeunzipandtar. your choice, your era. β¨perlβ the path to the perl executable to use for any perl calls. also used to determine the build version directory for extraction. multitasking icon. πverboseβ specifies whether to be verbose or not. defaults to your corresponding config entry.forceβ specifies whether to force the extraction or not. defaults to your corresponding config entry. sometimes you just gotta make it happen, ngl. π₯
all other options are passed on verbatim to __unzip or __untar. no editing, no filtering, she just forwards them. π
returns the directory the file was extracted to on success, and false on failure. success = path, failure = false, that's the whole contract, fr fr. β
heads up bestie: this is an internals module, so it's the backstage crew, not the main character you usually call directly. but she's carrying the whole show, lowkey. π
and that's the page!! π this was perl v5.40.1, dated 2025-03-01, from the User Contributed Perl Documentation crew β mwah, obsessed, bye bestie πβ¨
π¦ where this page comes from
- debian trixie: libcpanplus-perl 0.9916-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcpanplus-perl 0.9916-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcpanplus-perl 0.9916-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms