I've given a talk on using the techniques as CPAN authors use in their public code in your private code twice this year: originally at Milton Keynes Perl Mongers in April, then at YAPC Europe in August.
And finally I have put my slides online!
I have noticed that most companies arrange their code in an unstructured way, and contrasted this to how CPAN arranges code as small distributions packaged with documentation and tests. I advocated the idea of taking this approach with other Perl code, even if it will never live on CPAN.
I got some useful feedback after my talk and had several interesing discussions about it at the conference. So I thought I would write up various extra ideas here.
I mentioned CPAN::Mini::Inject, but didn't know about CPAN::Inject, which works with a full CPAN mirror instead of a CPAN::Mini mirror. I also didn't know about CPAN::Site which does much the same. I don't know which circumstances each works best in.
I mainly focused on ExtUtils::MakeMaker and Module::Install for packaging modules together. I deliberately ignored Module::Build and didn't know about ExtUtils::ModuleMaker.
The DPAN project on CPAN looks like an ambitious approach to solving the issues I covered and much more too. I probably won't look at it until it has more documentation (I'm a bit of a late adopter), but I should keep an eye on it.
I was grateful for the advice of others who have tried the approaches that I mentioned, sometimes following more thoroughly than I have done. If you're breaking out your code base into lots of small CPAN-style modules, you might find judging the appropriate level of granularity awkward. Talk to your colleagues and don't rush to break things apart too early.