There are a couple of ebuilds for CPAN modules in Gentoo. However, they're all done by hand and so are all slightly different and some are quite out of date. I got involved in a dicsussion on gentoo-user (and later gentoo-dev and then Gentoo bugzilla) on how the best way to integrate CPAN modules into Gentoo would be.
You can think of this as layering dependencies. The Perl modules have simple dependency information in the PREREQ_PM in Makefile.PLs. However, only dependencies on Perl modules are in there. It so happens that Compress::ZLib needs zlib installed. Thus in the dev-perl/Compress-Zlib ebuild, we have added a dependency on the zlib C library manually by adding '>=sys-libs-zlib-1.1.3' to DEPEND. So that if you try and install Compress::Zlib in Gentoo using "emerge Compress-Zlib" it will make sure you already have the zlib library installed, and if not will go off and install it first.
We initially thought of somehow merging CPAN.pm or CPANPLUS into emerge, but that was perhaps too much work. On the tube home last night, I considered how hard it would be to autogenerate ebuild files for the whole of CPAN. This would have the advantage of always being up to date (good as Gentoo is cutting edge generally) and would probably work for about 80% of modules.
Well, I did it. Read the bugzilla entry for the script, and two sample generated ebuilds. CPANPLUS helped a lot (but it could have helped more
My recent post above contains info on how it works and minor problems. Makefile.PLs which contain incorrect dependencies really annoy me. But the most annoying thing is Makefile.PLs that are interactive. Most don't need to be and I think they should be non-interactive by default. This will be my next crusade...
How do other distributions do this anyway? By hand? Yuck!