Mailinglist Archive: opensuse (3441 mails)

< Previous Next >
Re: [opensuse] Where do I find perl module C::Scan?
  • From: David Haller <opensuse@xxxxxxxxxx>
  • Date: Thu, 15 Jan 2009 01:42:22 +0100
  • Message-id: <20090115004222.GA6736@xxxxxxxxxxxxxxxxxx>

On Wed, 14 Jan 2009, Josef Wolf wrote:

So I decided to follow this suggestion and did (as root):

# perl -MCPAN -e "install C::Scan"
[ many lines of output deleted ]
Installing /usr/lib/perl5/site_perl/5.10.0/C/
Installing /usr/share/man/man3/C::Scan.3pm
Appending installation info to
/usr/bin/make install -- OK

But h2xs still complains that it can not find this module. "perl -v"
claims /usr/lib/perl5/site_perl/5.10.0 is contained in the @INC array.
But /usr/lib/perl5/site_perl/5.10.0/C is _not_ (notice the "/C" at the

And it should not. When Perl searches for Modules, it replaces '::' in
the modules name by the proper directory seperator (e.g. '/' on unix,
'\' on Windows and ':' on MacOS.

Then it iterates over @INC and some compiled in paths and tries to
find a module under the concatenated path from @INC and the converted
module name.

i.e. "C::Scan" is searched for in



so /usr/lib/perl5/site_perl/5.10.0/C/ would be found.

So here are my questions:
2. What is the proper way to add a directory to the @INC array?

That depends. Use the environment-variable PERL5LIB or the 'use lib'
directive. But, see above, that is not neccessary in your case. You
only need to modify @INC when you're adding a whole module-tree, such
as e.g. ~/lib/perl5/.

Anyways, the reason for your problem is probably that your user does
not have the rights to access the module file. Confirm by trying

less /usr/lib/perl5/site_perl/5.10.0/C/

as the user calling h2xs.

If you cannot read the file, do a

chmod -cR o+rX /usr/lib/perl5/site_perl/5.10.0/C

and use

OUMASK=`umask`; umask 022;
perl -MCPAN ... ;
umask $OUMASK


( umask 022; perl -MCPAN ... ; )

in the future, if you want to install a module via CPAN.


276: SMP
Fehlfunktion bei mehr als einer CPU. (nach Holger Veit)
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >