in reply to Re^5: Not able to use Net::SFTP module.
in thread Not able to use Net::SFTP module.

Appreciate your support. It worked what u told but now I have list of paths of modules which are not placed in @INC. (like math/Pari.pm, Digest/Sha1.pm) I am manually placing it using unshift but list seems endless. below is what I am doing.

BEGIN { unshift (@INC, "/home/eankuls/.cpan/build/Net-SSH-Perl-1.37-KSvjy6/bli +b/lib"); unshift (@INC, "/home/eankuls/.cpan/build/Math-Pari-2.01080607-oiJwzq/ +blib/lib"); unshift (@INC, "/home/eankuls/.cpan/build/Math-Pari-2.01080607-oiJwzq/ +blib/lib"); unshift (@INC, "/home/eankuls/.cpan/build/Crypt-DH-0.07-B70AtC/blib/li +b"); unshift (@INC, "/home/eankuls/.cpan/build/Digest-SHA1-2.13-lHIaOb/blib +/lib"); }

I just want to do it from starting. Could you pls suggest how can I unistall the previously installed modules and the exact list of modules which I need to run my script. This time I would prefer to download tar files from CPAN.

Replies are listed 'Best First'.
Re^7: Not able to use Net::SFTP module.
by vinoth.ree (Monsignor) on May 01, 2014 at 17:55 UTC
    Hey,

    It seems you do not have root access to install perl modules. In my first rely itself I have mentioned that If you are the system administrator and want to install the module system-wide, So you could have told us that you are a normal user trying to install a module, something like that. To install perl modules locally in your home directory you need to do setup local lib directory. Follow the steps,

    1.Create directories in your home directory ~/src, ~/lib and ~/downloads

    2.Download the .tar.gz file into ~/downloads

    3.Unpack the CPAN Perl module,

    cd ~/src tar -zxvf ~/downloads/your_module.tar.gz

    4.cd ~/src/your_module/

    5. What the conventional method you do here ?

    perl Makefile.PL make make test make install

    6.Here is the change in the step of perl module installation. In perl Makefile.PL setp you need to tell perl that you want this module to be installed in your local path by specifying the PREFIX=~/lib as,

    perl Makefile.PL PREFIX=~/lib/ make make test make install

    Change your Perl scripts so that they can find the Perl module that you have installed locally.

    Then set the environment variable in .bash_rc or .profile file as export PERL5LIB=~/lib/


    All is well

      thanx again. I followed the steps provided by you. It worked upto some extent. Below are the issues I am facing now. 1) Its again throwing below error.

      Can't locate Crypt/DSA.pm in @INC (@INC contains: /home/eankuls/src/Ne +t-SSH-Perl-1.37/blib/lib/ /home/eankuls/.cpan/build/Digest-HMAC-1.03- +SpRncH/blib/lib/ /home/eankuls/lib/lib/perl/5.14.2/ /home/eankuls/lib +/share/perl/5.14.2/ ~/lib/ /etc/perl /usr/local/lib/perl/5.14.2 /usr/ +local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl +/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at /home/eanku +ls/src/Net-SSH-Perl-1.37/blib/lib//Net/SSH/Perl/Key/DSA.pm line 14.

      So i need to download tar files and install the required modules again & again. 2)after installing (by tar files methods) all the modules, it is throwing the below error.

      Permission denied at /home/eankuls/src/Net-SFTP-0.10/blib/lib//Net/SF +TP.pm line 62. 60 my $ssh = Net::SSH::Perl->new($sftp->{host}, protocol => 2, 61 debug => $sftp->{debug}, @{ $param{ssh_args} }); 62 $ssh->login($param{user}, $param{password}, 'supress_she +ll'); 63 $sftp->{ssh} = $ssh;

      1st part is the error i am getting while running the acript & second one is the part of SFTP.pm containg 62nd line... please help

        "So i need to download tar files and install the required modules again & again"

        You don't, as you've already been advised.