zappy
zappy

Reputation: 2084

Can't locate SOAP/Lite.pm in @INC

I am trying to build LDV project by following this instructions, and i know nothing about perl.

i am getting the following error while running the test

ldv-task: NORMAL: Calling LDV-core.
Can't locate SOAP/Lite.pm in @INC (@INC contains: /home/acsia/perl5/perlbrew/perls/perl-5.10.0/lib/5.10.0/x86_64-linux /home/acsia/perl5/perlbrew/perls/perl-5.10.0/lib/5.10.0 /home/acsia/perl5/perlbrew/perls/perl-5.10.0/lib/site_perl/5.10.0/x86_64-linux /home/acsia/perl5/perlbrew/perls/perl-5.10.0/lib/site_perl/5.10.0 .) at /home/acsia/Desktop/LDV/consol-tools/ldv-core/ldv-core line 7.
BEGIN failed--compilation aborted at /home/acsia/Desktop/LDV/consol-tools/ldv-core/ldv-core line 7.

output of

perlbrew use

is :EDITED:

Currently using perl-5.22.0

output of

locate SOAP/Lite.pm

is

/usr/local/lib/perl5/site_perl/5.22.0/SOAP/Lite.pm

output of

which perl

is

/usr/local/bin/perl

and the LDV-core file is starting like this by default

#!/usr/bin/perl -w
#
my $instrumnet = 'ldv-core';

use FindBin;
# To prevent meaningless module warnings use this instead of use.
BEGIN { $SIG{'__WARN__'} = sub{}; require SOAP::Lite; SOAP::Lite->import(); $SIG{__WARN__}='DEFAULT'; }
use POSIX ":sys_wait_h";
use XML::Twig;
use IO::Socket::INET;
#use File::MimeInfo;
use File::Basename;
use Cwd qw(abs_path);

etc,... etc....

Thanks for your time...

Upvotes: 1

Views: 6710

Answers (2)

ikegami
ikegami

Reputation: 385857

If LDV-Core isn't yours, you should install SOAP::Lite using your system's package manager. If it's yours, read on.


perlbrew plays with your PATH so that executing perl will execute the desired perl.

But your script explicitly uses /usr/bin/perl, so which perl is currently selected using perlbrew switch or perlbrew use is irrelevant.

  1. Stop overriding the default install location, and stop looking where you shouldn't.

    unset PERL_MM_OPT
    unset PERL_MB_OPT
    unset PERL5LIB
    unset PERLLIB
    
    echo -ne 'o conf makepl_arg ""\no conf commit\n'   | cpan
    echo -ne 'o conf mbuildpl_arg ""\no conf commit\n' | cpan
    

    The first four lines only have a temporary effect. You should stop setting those variables in your login script to make the change permanent.

  2. Install SOAP::Lite in the desired Perl.

    perlbrew use perl-5.22.0    # Or perl-5.10.0 or whatever
    cpan SOAP::Lite
    
  3. Fix your script's shebang.

    perl -i~ -pe'
       next if $. != 1;
       s/^#!.*//s;
       $_ = "#!$^X\n$_";
    ' LDV-core
    

PS — You don't need use FindBin;.

Upvotes: 4

shivams
shivams

Reputation: 2717

perlbrew perl is a way to install many perl versions in same machine. It is like virtenv in python. Perlbrew allow you to switch between various versions of perl and run perl programs against those versions.

system perl means the default version of perl which mostly come with linux distros. perlbrew changes that version against which program needs to run and your program will start running against different version.

If you are making something which does not require a lot of perl versions it is always better to use one version of perl and run programs against them.

Also if you are using linux distros and do not want to get into cpan and how to install perl modules, best is to search for corresponding libraries against that module and install them. For example in your case i search this way

aptitude search soap | grep perl

This give me two libraries on my ubuntu machine of which one is against this module. Installing them is easy and you can focus on your work rather than on how to install cpan modules.

Upvotes: 2

Related Questions