Perl CPAN modules can be installed via user or via machine. Normally, if you 
can't get root access on the machine, you install it for that user. Maybe the 
Log::Log4perl module is installed as a user module. Thus, if you're running it 
as another user, you simply can't find the module.

Another possibility is that the module wasn't installed, and is located in a 
different directory than expected. The Perl @INC shows you the directories 
where modules are searched. The %INC hash shows the module loaded and the 
directory where found. 

Try a simple program:

use strict;
use warnings;
use feature qw(say);

use Log::Log4Perl

say "Perl \@INC: " . join "\n", @INC;
for my $module (sort keys %INC) {
    say qq(\$INC{$module} = "$INC{$module}");
}

Do this via SSH where you can execute run_prove.sh and it works. This will show 
you where this program is searching for the module and where it finds it. That 
will give you an idea why Jenkins can't find it.

If you do find that Log::Log4Perl is not where you expect it, use the "use lib" 
pragma to add that directory to your @INC search array.

On Nov 1, 2012, at 12:15 PM, Kamal Ahmed <kamal2222ah...@yahoo.com> wrote:

> Hi,
> When i run run_prove.sh after doing an ssh to host , the perl unit tests run 
> fine
> but when i do it via "Execute shell script on remote host using ssh" i get 
> error:
> 
> 11:41:35 + prove -b -v -r .
> 11:41:35 /usr/bin/prove: Cannot find blib
> 11:41:35 No blib directories found.
> 11:41:35 Can't locate Log/Log4perl.pm in @INC (@INC contains: 
> 
> I have tried with just execute shell script option as well, same result
> 
> Would appreciate any help / Hint/Resolution
> 
> Thanks,
> -Kamal.
> 
> 

Reply via email to