Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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

by vinoth.ree (Monsignor)
on Apr 30, 2014 at 05:27 UTC ( [id://1084432]=note: print w/replies, xml ) Need Help??


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

Hi,

Oops! hold on a sec. In the BEGIN block you need to provide the path as below,

#! usr/bin/perl BEGIN { unshift (@INC, "/home/eankuls/.cpan/build/Net-SSH-Perl-1.37-AUG9Mn/bli +b/lib/"); }

Because, when you do use Net::SSH::Perl::Buffer Perl will replace :: to / and will search for Buffer.pm as Net/SSH/Perl/Buffer.pm in your @INC variable.

I am very sure if you change the path in BEGIN block it should work for you.


All is well

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

    This is the cpan temporary area, these modules aren't installed properly. Please don't advise anyone to do this.

    Update: fix typo.

Re^6: Not able to use Net::SFTP module.
by Ankur_kuls (Sexton) on May 01, 2014 at 04:33 UTC

    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.

      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

Re^6: Not able to use Net::SFTP module.
by Ankur_kuls (Sexton) on May 01, 2014 at 04:58 UTC

    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 coz other method is causing some permission problems.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1084432]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-24 01:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found