CPANPLUS::Dist(3pm)
β¨ CPANPLUS::Dist β the base class for plugins, bestie π
okay so this is CPANPLUS::Dist, and it's the base class for plugins. that's the whole vibe. it's the blueprint, the mother, the main character that all the dist-type girlies inherit from. π«Ά
πΈ SYNOPSIS πΈ
my $dist = CPANPLUS::Dist::YOUR_DIST_TYPE_HERE->new(
module => $modobj,
);
like... that's it. that's the whole entrance. iconic. β¨
π DESCRIPTION π
so CPANPLUS::Dist is the base class for CPANPLUS::Dist::MM and CPANPLUS::Dist::Build. if you're a dev cooking up your own CPANPLUS::Dist::* plugin, bestie, you should go look at CPANPLUS::Dist::Base β that's your blueprint. periodt. π
π ACCESSORS π
parent()β hands you back theCPANPLUS::Moduleobject that parented this object. your origin story, fr. πstatus()β returns theObject::Accessorobject that keeps the status for this module. it's the little diary where everything gets written down. π
π¦ STATUS ACCESSORS π¦
all of these can be reached like this:
$deb->status->ACCESSOR
so yes, you go through status first. it's giving backstage pass. ποΈ
created()β boolean saying whether the dist was created successfully or not. it gets explicitly set to0when it fails, so if you seeundefyou should read that as "not yet attempted". not a fail, just... not yet, bestie. πinstalled()β boolean for whether the dist installed successfully. same rules: explicitly0on failure, soundefmeans "not yet attempted". πuninstalled()β boolean for whether the dist uninstalled successfully. and again: explicitly0when it fails, soundef= "not yet attempted". consistent queen. πdist()β the location of the final distribution. heads up: this might be a file or a directory, depending on how your distribution plugin of choice works. it gets set once a create succeeds. π
β the methods, let's go β
π« $dist = CPANPLUS::Dist::YOUR_DIST_TYPE_HERE->new( module => MODOBJ );
makes a brand new CPANPLUS::Dist::YOUR_DIST_TYPE_HERE object based on the MODOBJ you hand it. π«Ά
π¨ * DEPRECATED * π¨ the optional argumentformatis used to say what type of dist you wanna create (likeCPANPLUS::Dist::MMorCPANPLUS::Dist::Buildand so on). it's deprecated, so like... don't build your whole personality around it, okay?
and important: CPANPLUS::Dist->new is exclusively meant as a method to be inherited by CPANPLUS::Dist::MM|Build. it's not for you to call directly, it's for the children. π
returns a CPANPLUS::Dist::YOUR_DIST_TYPE_HERE object on success, and false on failure. slay or flop, no in between. β¨
π« @dists = CPANPLUS::Dist->dist_types;
returns a list of the CPANPLUS::Dist::* classes that are available. the whole roster. the lineup. π
π« $bool = CPANPLUS::Dist->rescan_dist_types;
rescans @INC for available dist types. super useful if you just installed some new CPANPLUS::Dist::* classes and you want the current process to actually know about them. refresh the vibe check, bestie. π
π« $bool = CPANPLUS::Dist->has_dist_type( $type )
returns true if the distribution type $type is loaded/supported. yes or no, that's the tea. π΅
π« $bool = $dist->prereq_satisfied( modobj => $modobj, version => $version_spec )
returns true if this prereq is satisfied, false if it's not. also throws an error if it seems "unsatisfiable" β meaning it can't be found on CPAN, or the latest CPAN version just doesn't satisfy it. π like it's not being difficult on purpose, it's genuinely impossible.
π« $configure_requires = $dist->find_configure_requires( [file => /path/to/META.yml] )
reads the configure_requires for this distribution from the META.yml or META.json file sitting in the root directory, and returns a hashref with the module names and versions required. receipt printer energy. π§Ύβ¨
π« $bool = $dist->_resolve_prereqs( ... )
makes sure the prerequisites are actually resolved. no loose ends. π here's what you can pass:
formatβ the dist class to use to make the prereqs (ie.CPANPLUS::Dist::MM).prereqsβ hash of the prerequisite modules and their versions.targetβ what to actually do with the prereqs:create=> just build theminstall=> install themignore=> ignore them π
prereq_buildβ if true, always build the prereqs even if they're already resolved. extra. thorough. we love her.verboseβ be verbose. tell me everything, bestie. π£οΈforceβ force the prereq to be built, even if it's already resolved. no cap. π₯
and that's the page, babes. this little masterpiece is perl v5.40.1, dated 2025-03-01, and it lives its life as CPANPLUS::Dist(3pm) β go forth and build ur dists, you absolute icon. ππ¦β¨
π¦ 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