Some module tarballs on CPAN do not follow the filename convention of modulename-version.tar.gz, instead calling themselves modulename.pm-version.tar.gz (for example the CGI module). The regular expression in g-cpan's portage_dir sub fails to correctly convert these filenames to ebuild directories. Reproducible: Always Steps to Reproduce: 1. Install CGI.pm from normal emerge commands 2. Run g-cpan.pl CGI::Application 3. Observe! Actual Results: g-cpan.pl will always try to re-install CGI, as it can't find ebuild directory 'CGI.pm' Expected Results: Detect that CGI is already installed. Managed to cure the issue by simple modification of the regular expression in portage_dir sub to remove any trailing ".pm".
Created attachment 44119 [details, diff] Patch to fix .pm breakage in g-cpan.pl Ran into the exact same problem myself, added the following patch to remove the trailing .pm from CPAN module names. Not heavily tested, but it allowed me to finally install CGI::Application, which depended on CGI.pm.
Applied in next version of g-cpan (so next version of portage)