CPANPL...st::MM(3pm)
π CPANPLUS::Dist::MM β the manual, but make it make sense
okay bestie so real quick: this is the manual page for CPANPLUS::Dist::MM, which lives in section 3pm of the perl docs (User Contributed Perl Documentation, to be exact). It's the distribution class for MakeMaker-related modules. Let's get into it π
β¨ NAME β¨
CPANPLUS::Dist::MM β the distribution class for MakeMaker related modules. that's it, that's the name, slay π
π¦ SYNOPSIS π¦
$mm = CPANPLUS::Dist::MM->new( module => $modobj );
$mm->create; # runs make && make test
$mm->install; # runs make install
see how simple? you make the object, you create, you install. main character energy fr fr π«
π DESCRIPTION π
so CPANPLUS::Dist::MM is a distribution class for MakeMaker related modules. using this package you can create, install and uninstall perl modules. and the way that it inherits from CPANPLUS::Dist? iconic. it's giving family tree, it's giving legacy π«Ά
π ACCESSORS π
parent()β hands you theCPANPLUS::Moduleobject that parented this object. your origin story, basically πstatus()β hands you theObject::Accessorobject that keeps the status for this module. the vibe tracker π
πΈ STATUS ACCESSORS πΈ
all of these get accessed like this, no cap:
$mm->status->ACCESSOR
makefile ()β where theMakefile(orBuildfile) lives. it gets set to0explicitly if something went wrong. that's the "oop π" value.make ()β a BOOL saying if themake(orBuild) command was successful.test ()β a BOOL saying if themake test(orBuild test) command was successful.prepared ()β a BOOL saying if thepreparecall exited successfully. this one gets set afterperl Makefile.PL.distdir ()β full path to the directory where thepreparecall took place. gets set after a call toprepare.created ()β a BOOL saying if thecreatecall exited successfully. gets set aftermakeandmake test.installed ()β a BOOL saying if the module was installed. gets set aftermake install(orBuild install) exits successfully.uninstalled ()β a BOOL saying if the module was uninstalled properly._create_args ()β storage for the arguments passed tocreatefor this object. used for recursive calls when satisfying prerequisites. sneaky little helper π₯_install_args ()β storage for the arguments passed toinstallfor this object. also used for recursive calls when satisfying prerequisites.
π₯ METHODS π₯
β $bool = $dist->format_available();
returns a boolean telling you whether or not you can use this package to create and install modules in your environment. vibe check on your setup, basically π
β $bool = $dist->init();
sets up the CPANPLUS::Dist::MM object for use. effectively it creates all the needed status accessors.
it gets called automatically whenever you create a new CPANPLUS::Dist object, so you don't even have to ask π§
β $bool = $dist->prepare([perl => '/path/to/perl', makemakerflags => 'EXTRA=FLAGS', force => BOOL, verbose => BOOL])
prepare preps a distribution for installation. translation: it runs perl Makefile.PL and figures out what prerequisites this distribution declared. doing the groundwork, bestie π
if you set force to true, it goes over all the stages of the prepare process again, ignoring any previously cached results. no shortcuts, no memory π
when running perl Makefile.PL, the environment variable PERL5_CPANPLUS_IS_EXECUTING gets set to the full path of the Makefile.PL that is being executed. this lets any code inside the Makefile.PL know that it's being installed via CPANPLUS. it's literally telling on itself π«Ά
returns true on success and false on failure.
you may then call $dist->create on the object to create the installable files.
β $href = $dist->_find_prereqs( file => '/path/to/Makefile', [verbose => BOOL])
parses a Makefile for PREREQ_PM entries and distills from that any prerequisites mentioned in the Makefile. detective work π΅οΈβοΈ
returns a hash with module-version pairs on success and false on failure.
β $bool = $dist->create([perl => '/path/to/perl', make => '/path/to/make', makeflags => 'EXTRA=FLAGS', prereq_target => TARGET, skiptest => BOOL, force => BOOL, verbose => BOOL])
create creates the files necessary for installation. it runs make and make test, and it'll also scan for and attempt to satisfy any prerequisites the module may have. multitasking queen π
if you set skiptest to true, it skips the make test stage. if you set force to true, it goes over all the stages of the make process again, ignoring any previously cached results. it will also ignore a bad return value from make test and still allow the operation to return true. bold. risky. iconic π₯
returns true on success and false on failure.
you may then call $dist->install on the object to actually install it.
β $bool = $dist->install([make => '/path/to/make', makemakerflags => 'EXTRA=FLAGS', force => BOOL, verbose => BOOL])
install runs this command, verbatim:
make install
returns true on success, false on failure. periodt π
β $bool = $dist->write_makefile_pl([force => BOOL, verbose => BOOL])
this routine can write a Makefile.PL from the information in a module object. it's used to write a Makefile.PL when the original author forgot it (!!). not me fixing someone else's homework π
returns 1 on success and false on failure.
the file gets written to the directory the module's been extracted to.
heads up bestie: that(!!)up there is the original author's energy, not mine. the forgotten-Makefile.PLsituation is real and it is a mess π
and that's the whole page!! you now know CPANPLUS::Dist::MM better than it knows itself. go forth and create, install, and maybe uninstall π
β sign-off from your fave: this was perl v5.40.1, dated 2025-03-01. no cap, that's the version, that's the date, love that for us πβ¨π¦
π¦ 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