in reply to Maintaining Local CPAN Patches

Well, what I would do is to introduce a new directory in your production @LIB path, to contain your patched modules. This directory must of course occur early in the list so that it will always be chosen first. In other words, even as CPAN is used to update the main CPAN directories on your system, these packages will never actually be selected by Perl from those directories. Instead, your patched versions will be discovered and used first.

Now, you need a reliable system for maintaining those patches so that you can maintain your changes and incorporate the regular CPAN-derived changes, all at the same time. For that, you need to set up and use a version-control system. subversion (svn) might be an apropos choice, since that's generally what CPAN uses.

See: http://en.wikipedia.org/wiki/Subversion_(software)#Branching_and_tagging.

You would start by checking-in the original code from CPAN, which you used to create your original patch. That's your “base vendor-branch.” Tag this as your original starting-point. Now, branch off from that and check-in your modified code to create the first “production branch.” svn will automatically determine the source-code differences between the two.

Now, from time to time, as CPAN updates its modules, you can check those in on the vendor-branch (the total set of changes made in CPAN will be captured), tagging them as you go. Next, merge those back into your production-branch, which contains your revisions, and tag that also as-you-go.

If there are any conflicts between the two, you'll automatically be notified and can resolve them on a case-by-case basis. (The by-product of that resolve-step is, of course, another explicit revision, that gets committed into the system, so you know exactly what was done.)

In general, this will allow you to reliably, and for the most part, automagically, maintain your site-specific patches and apply them to the CPAN-derived code ... thus maintaining both the ability to make local changes and the ability to employ CPAN's latest-and-greatest. Furthermore, you can at any time revert back to any previous change-point, e.g. to any one of the “tags” that you set along the way on any branch. You can compare any one to any other with absolute accuracy.

You're always storing your merged revisions back to the local directory that you've created for that purpose; the one that's listed early in @LIB. Although CPAN is updating the main directory, you're solely maintaining the version of these modules that you employ in production ... through the version-control system.