Devel:...Plugin(3pm)

πŸ’– NAME πŸ’–

Devel::PatchPerl::Plugin β€” bestie, this is where the whole Devel::PatchPerl plugin system gets explained. (And yes, the page you're reading is literally Devel:...Plugin(3pm), from the User Contributed Perl Documentation, so you're in the right place 🫢)


✨ VERSION ✨

version 2.14 β€” that's the one, no cap.


πŸ¦‹ DESCRIPTION πŸ¦‹

So this doc is the explainer for the Devel::PatchPerl plugin system. Here's the tea:

  • Plugins are a whole mechanism for handing extra functionality to Devel::PatchPerl. Think of them as little accessory packs. πŸŽ€
  • Plugins get searched for in the Devel::PatchPerl::Plugin namespace. That's their home turf, that's where they live.

🌸 INITIALISATION 🌸

The plugin constructor is patchperl. That's the name it answers to. πŸ’…

You tell Devel::PatchPerl which plugin you want by setting the PERL5_PATCHPERL_PLUGIN environment variable. And you've got two flavours of correct here, both slay:

  • the full name, like Devel::PatchPerl::Plugin::Feegle
  • or the short part, like Feegle

Either one works:

$ export PERL5_PATCHPERL_PLUGIN=Devel::PatchPerl::Plugin::Feegle

$ export PERL5_PATCHPERL_PLUGIN=Feegle

Once Devel::PatchPerl has figured out the perl source patch and finished doing its patching thing, it will go ahead and try to load the plugin you named. Then it calls the class method patchperl on that plugin package, handing over these parameters:

'version', the Perl version of the source tree;
'source', the absolute path to the Perl source tree;
'patchexe', the 'patch' utility that can be used;

Lowkey important: plugins get called with the current working directory set to the root of the Perl source tree, i.e. source. So don't be out here assuming you're anywhere else. πŸ™ˆ

Here's the whole thing, summarised:

$ENV{PERL5_PATCHPERL_PLUGIN} = 'Devel::PatchPerl::Plugin::Feegle';

my $plugin = $ENV{PERL5_PATCHPERL_PLUGIN};

eval "require $plugin";

eval {
  $plugin->patchperl( version => $vers, source => $srcdir, patchexe => $patch );
};

And one more thing that is entirely on the plugin, not on anyone else: plugins are responsible for checking that their own patches actually apply to the version of perl being patched. That's the plugin's job, its problem, its moment. 🧚


πŸ”₯ WHAT CAN PLUGINS DO? πŸ”₯

Anything you desire to a Perl source tree. Fr fr. That's the whole answer. Main character energy, zero limits. πŸ‘‘


🌈 WHY USE AN ENVIRONMENT VARIABLE TO SPECIFY PLUGINS? 🌈

Great question bestie. The reason is so that indicating which plugin to use can happen independently of whatever mechanism is out there calling Devel::PatchPerl to do its bidding.

Think perlbrew. That's the vibe. ✨


πŸ’œ AUTHOR πŸ’œ

Chris Williams <chris@bingosnet.co.uk>


This software is copyright (c) 2025 by Chris Williams and Marcus Holland-Moritz.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.


okay that's the whole page, you ate that πŸ’…

And for the record, this was perl v5.40.1, dated 2025-10-04, closing out Devel:...Plugin(3pm). Byeee πŸ¦‹πŸ’–

πŸ“¦ where this page comes from