Devel::PatchPerl(3pm)

πŸ’– Devel::PatchPerl πŸ’–

okay bestie, so you know how Devel::PPPort has that buildperl.pl script that patches perl source? yeah. this is that, but modularised. that's literally the whole vibe. ✨

<h2>VERSION</h2>

version 2.14 πŸŽ€ (yes we're on 2.14, keep up)


🌈 SYNOPSIS

use strict;
use warnings;

use Devel::PatchPerl;

Devel::PatchPerl->patch_source( '5.6.1', '/path/to/untarred/perl/source/perl-5.6.1' );

that's it, that's the whole thing, go off πŸ‘‘


✨ DESCRIPTION

so Devel::PatchPerl is a modularisation of the patching code that lives inside Devel::PPPort's buildperl.pl. we took it out, gave it its own lil home, gave it main character energy. πŸ’…

important tho: it does not build perls. it is not about building. it merely provides an interface to the source patching functionality. patching only. don't ask it to build. πŸ™ˆ


🫢 FUNCTION

patch_source

  • takes two parameters: a perl version, and the path to the unwrapped perl source for that version.
  • it dies on any errors. no chill, just death. πŸ’€
  • if you don't supply a perl version, it will try to auto-determine the perl version from the path you gave it. smart girl behavior.
  • if you don't supply the path to the unwrapped perl source, it will assume the current working directory. lowkey convenient.

determine_version

  • takes one optional parameter: the path to the unwrapped perl source.
  • it returns the perl version of the source code at that location. πŸŽ€
  • it returns undef on error. sad but honest.
  • if you don't supply the path to the unwrapped perl source, it will assume the current working directory. again. consistent queen.

🧚 PLUGIN SYSTEM

see Devel::PatchPerl::Plugin for the details of Devel::PatchPerl's plugin system. iykyk πŸ’œ


πŸ”₯ PATCHLEVEL

okay so Devel::PatchPerl will normally update the patchlevel.h file inside the perl source tree to show that it has applied local patches. cute, right?

but β€” and this is the plot twist β€” that behaviour is negated if it detects that it's operating in a git repository. πŸ™ˆ

to override that and update patchlevel.h while you're in a Git repository, set the env var PERL5_PATCHPERL_PATCHLEVEL to a true value. periodt.

alternatively, just call patchperl with the --patchlevel option. same energy, different door. πŸ¦‹


πŸ’€ CAVEAT

Devel::PatchPerl is intended only to facilitate the building of perls. it is not intended to facilitate the testing of perls.

that means: it will not patch failing tests in the perl testsuite. if you came here hoping it would fix your broken tests, bestie, no. it won't. read the room. 😭


🌸 SEE ALSO

  • Devel::PPPort
  • Devel::PatchPerl::Plugin

πŸ‘‘ 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're welcome, go patch some perl source bestie πŸ«ΆπŸ“βœ¨

<span>perl v5.40.1</span> Β· <span>2025-10-04</span> β€” that's the version and the date this whole thing was baked, mwah πŸ’‹ byeee 🌈

πŸ“¦ where this page comes from