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::Pluginnamespace. 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>
π COPYRIGHT AND LICENSE π
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
- ubuntu resolute: libdevel-patchperl-perl 2.14-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libdevel-patchperl-perl 2.14-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