When it comes to Gentoo and programming languages the package system of Gentoo (Portage) and the package system of the language collide. That's mostly because the Gentoo developers think they have to resolve all dependencies by the Gentoo Portage System.
If you have read my old article about "Gentoo Linux and Ruby" you know what I mean.
Gentoo and Perl CPAN have a quite similar problem. The Perl Package Management does not honor Gentoo (with a good default permission set) and Gentoo can't honor already installed CPAN packages and to resolve its own Portage dependency hell.
So, once you install a package with CPAN by:
cpan install Net::Twitter::Lite
You end up with permissions that won't let your users find the newly installed module. Instead they find the following error message slightly amusing:
Can't locate Net/Twitter/Lite.pm in @INC (@INC contains: /etc/perl /usr/lib/perl5/site_perl/5.12.4/i686-linux-thread-multi /usr/lib/perl5/site_perl/5.12.4 /usr/lib/perl5/vendor_perl/5.12.4/i686-linux-thread-multi /usr/lib/perl5/vendor_perl/5.12.4 /usr/lib/perl5/site_perl/5.12.3/i686-linux-thread-multi /usr/lib/perl5/site_perl/5.12.3 /usr/lib/perl5/site_perl/5.12.2/i686-linux-thread-multi /usr/lib/perl5/site_perl/5.12.2 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.12.4/i686-linux-thread-multi /usr/lib/perl5/5.12.4 /usr/local/lib/site_perl .) at ./twitter.pl line 12. BEGIN failed--compilation aborted at ./twitter.pl line 12.
The permission are:
ls -l /usr/lib/perl5/site_perl/5.12.4/Net/Twitter drwxr-x--- 2 root root 4096 Jun 16 17:53 Lite -r--r--r-- 1 root root 143714 May 8 18:06 Lite.pm
That's the problem. Other users don't have read access on the Perl package directories by default!
Gentoo developers like complexity
The Easy Fix
What is the easiest fix for you and for me?
Be pragmatic, as root do:
cd /usr/lib/perl5 find -type d | xargs chmod o+rx find -type f | xargs chmod o+r
Of course you can put those lines in your own shellscript for a quicker execution. Whenever I install a Perl CPAN package as root I start that simple shellscript.