Datum::MakeMaker(3pm)

πŸ“¦
version 0.1.3 Β· 2 versions
  • 0.1.3 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.1.3 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 πŸŽ€βœ¨πŸ¦‹