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

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

Replies are listed 'Best First'.
Re^8: Not able to use Net::SFTP module.
by marto (Cardinal) on May 07, 2014 at 08:07 UTC
Re^8: Not able to use Net::SFTP module.
by Ankur_kuls (Sexton) on May 07, 2014 at 06:08 UTC

    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.