Datum::MakeMaker(3pm)
π Datum::MakeMaker(3pm) π
okay bestie, so this page lives in the User Contributed Perl Documentation section, and it's filed under Datum::MakeMaker(3pm). It's giving "make your builds smarter" energy, and honestly? Iconic. Let's get into it. π¦
β¨ NAME β¨
Carp::Datum::MakeMaker β it offers to strip Carp::Datum calls statically. Like, at build time. Before they even get to run around in your code. π
πΈ SYNOPSIS πΈ
# Put this at the top of the Makefile.PL for your module
use ExtUtils::MakeMaker; # you may omit this line
use Carp::Datum::MakeMaker;
no cap, that's literally it. two lines (or one, if you're feeling bold). β¨
π DESCRIPTION π
So Carp::Datum::MakeMaker supersedes the regular WriteMakefile() routine from ExtUtils::MakeMaker. It's the glow-up version. π
When you run the Makefile.PL from a module interactively, the user gets asked whether calls to Carp::Datum should be stripped at build time. Like, it checks in with them first. Communication queen. π«Ά
By default β or whenever it's running non-interactively β most calls to Carp::Datum routines get removed. The datum_strip program gets invoked to filter *.pm files during the build process. And that program? It's a mere wrapper for the datum_strip() routine, which is defined over in Carp::Datum::Strip. Teamwork fr fr. π
Not me about to tell you the one exception π
The only call that will not be stripped is the DTRACE() call. But it doesn't just sit there untouched either β it gets dynamically remapped to a Log::Agent call. Why dynamic and not static, you ask? Because of its baroque interface, bestie. It literally cannot be statically remapped. It's too extra for that. π
So, at the top of Makefile.PL, you insert:
use Carp::Datum::MakeMaker;
and that line takes care of loading ExtUtils::MakeMaker for you. Considerate. π
And lowkey, it makes sense to refer to this module, because Carp::Datum is being used internally β which means the user will not be able to install the module if they don't already have Carp::Datum installed. It's a whole dependency situation. iykyk. π
π§ If You Wanna Be Nicer About It π§
If you wish to be nicer about Carp::Datum not being installed, you can say this instead:
use ExtUtils::MakeMaker;
eval "use Carp::Datum::MakeMaker;";
WriteMakefile(
'NAME' => "Your::module::name",
'PREREQ_PM' => {
'Carp::Datum' => '0.100',
},
);
This lets them run the Makefile.PL and still get reminded about the missing Carp::Datum module. Gentle parenting, but for installs. π
Chances are they won't be able to go much farther though... π
π AUTHORS π
Christophe Dehaudt and Raphael Manfredi are the original authors. Legends, honestly.
Send bug reports, hints, tips, suggestions to Dave Hoover at <squirrel@cpan.org>. He's the main character of the inbox. π¬
π« SEE ALSO π«
and that's the whole vibe check, bestie π this was perl v5.34.0, dated 2022-06-30, filed under Datum::MakeMaker(3pm). slay, go build something cute πβ¨π¦
π¦ where this page comes from
- debian bookworm: libcarp-datum-perl 1:0.1.3-9 Β· Artistic-1.0-Perl
- debian trixie: libcarp-datum-perl 1:0.1.3-9 Β· Artistic-1.0-Perl
- ubuntu noble: libcarp-datum-perl 1:0.1.3-9 Β· Artistic-1.0-Perl
- ubuntu resolute: libcarp-datum-perl 1:0.1.3-9 Β· Artistic-1.0-Perl
- ubuntu stonking: libcarp-datum-perl 1:0.1.3-9 Β· Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms