Why does my Perl program complain "Cannot find URI.pm in @INC"?

I am new to Perl. I get the following error when running the script:

Can't locate URI.pm in @INC (@INC contains: /usr/local/packages/perl_remote/5.6.1/lib/5.6.1/i86pc-solaris /usr/local/packages/perl_remote/5.6.1/ lib / 5.6.1 /usr/local/packages/perl_remote/5.6.1/lib/site_perl/5.6.1/i86pc-solaris /usr/local/packages/perl_remote/5.6.1/lib/site_perl/5.6.1 / usr / local / packages / perl_remote / 5.6.1 / lib / site_perl.) at (eval 2) line 3.
Compilation failed in require at /usr/local/packages/perl_remote/5.6.1/lib/site_perl/5.6.1/HTTP/Request.pm line 3.
Compilation failed in require at /usr/local/packages/perl_remote/5.6.1/lib/site_perl/5.6.1/LWP/UserAgent.pm line 10.
BEGIN failed - compilation aborted at /usr/local/packages/perl_remote/5.6.1/lib/site_perl/5.6.1/LWP/UserAgent.pm line 10.
Compilation failed in require at /usr/local/packages/perl_remote/5.6.1/lib/site_perl/5.6.1/LWP/Simple.pm line 26.
BEGIN failed - compilation aborted at /usr/local/packages/perl_remote/5.6.1/lib/site_perl/5.6.1/LWP/Simple.pm line 26.
Compilation failed in require at txotf_0_install.pl line 35.
BEGIN failed - compilation aborted at txotf_0_install.pl line 35.

What could be the possible reasons for this and how can I make the script work. Any help would be appreciated.

+3
source share
5 answers
  • , URI. , "" .

    • , CPAN.
    • , , .

CPAN, , , , . CPAN , .

, , @INC, .

  • Perl 5 , PERL5LIB. "" ​​ @INC. , $ENV{PERL5LIB} . (. )

  • - script. use lib @INC. (. lib)

    use lib '/path/to/URI/module';
    use URI;
    
  • , . perl -I perl -I/path/to/URI/module -e 1 (. perlrun)

+8

@INC (, /usr/local/packages, perl_remote ..) , perl, , , , .

.

+7

@INC Perl. script , @INC. :

  • script @INC;
  • $PATH;
  • script .
+1

, - (, , ), , . , OP, , -, , ...

CentOS, , @INC , , , mod_perl , " " . , " lib" , Apache PerlRequire , .

SELinux, . /var/log/messages, , , .

0

perl bin PATH. , ActivePerl, perl.

0

Source: https://habr.com/ru/post/1733153/


All Articles