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>
Hello,

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/Scan.pm
Installing /usr/share/man/man3/C::Scan.3pm
Writing
/usr/lib/perl5/site_perl/5.10.0/x86_64-linux-thread-multi/auto/C/Scan/.packlist
Appending installation info to
/usr/lib/perl5/5.10.0/x86_64-linux-thread-multi/perllocal.pod
HVDS/C-Scan-0.74.tar.gz
/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
end)

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

@INC:
/usr/lib/perl5/5.10.0/x86_64-linux-thread-multi
/usr/lib/perl5/5.10.0
/usr/lib/perl5/site_perl/5.10.0/x86_64-linux-thread-multi
/usr/lib/perl5/site_perl/5.10.0
/usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.10.0
/usr/lib/perl5/vendor_perl

/usr/lib/perl5/5.10.0/x86_64-linux-thread-multi/C/Scan.pm
/usr/lib/perl5/5.10.0/C/Scan.pm
/usr/lib/perl5/site_perl/5.10.0/x86_64-linux-thread-multi/C/Scan.pm
/usr/lib/perl5/site_perl/5.10.0/C/Scan.pm
/usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/C/Scan.pm
/usr/lib/perl5/vendor_perl/5.10.0/C/Scan.pm
/usr/lib/perl5/vendor_perl/C/Scan.pm

so /usr/lib/perl5/site_perl/5.10.0/C/Scan.pm 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/Scan.pm

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

or

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

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

HTH,
-dnh

--
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 >
References