I am using perl, v5.10.1 on my Linux Ubuntu machine. I tried to install Net::SFTP
module through cpan
prompt but its giving the below errors for past 2 days.
warning:
Warning: no success downloading
'/root/.cpan/sources/authors/01mailrc.txt.gz.tmp19821'. Giving up on
it. at /usr/share/perl5/CPAN/Index.pm line 225
error:
Connecting to www.perl.org|207.171.7.51|:80... failed: Connection
timed out.
Connecting to www.perl.org|207.171.7.41|:80... failed: Connection
timed out.
Then I installed it by tar file method through CPAN site. now when I run the below sample script its throwing me the error.
script:
use Net::SFTP;
my $host = "169.144.106.231";
my %args = (
user => "root",
password => "******" );
my $sftp = Net::SFTP->new($host, %args);
Error:
Can't locate Net/SSH/Perl/Buffer.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/share/perl5/Net/SFTP/Buffer.pm line 6.
BEGIN failed--compilation aborted at /usr/local/share/perl5/Net/SFTP/Buffer.pm line 6.
Compilation failed in require at /usr/local/share/perl5/Net/SFTP/Attributes.pm line 7.
BEGIN failed--compilation aborted at /usr/local/share/perl5/Net/SFTP/Attributes.pm line 7.
Compilation failed in require at /usr/local/share/perl5/Net/SFTP.pm line 8.
BEGIN failed--compilation aborted at /usr/local/share/perl5/Net/SFTP.pm line 8.
Compilation failed in require at ankur_sftp.pl line 6.
BEGIN failed--compilation aborted at ankur_sftp.pl line 6.
I don't have Net/SSH/Perl/Buffer.pm
installed and few modules like Buffer.pm
are residing at some other path.
/root/Net-SFTP-0.10/blib/lib/Net/SFTP/Buffer.pm
/root/Net-SFTP-0.10/lib/Net/SFTP/Buffer.pm
My @INC
contains
/usr/local/lib64/perl5
/usr/local/share/perl5
/usr/lib64/perl5/vendor_perl
/usr/share/perl5/vendor_perl
usr/lib64/perl5
/usr/share/perl5
Can anyone please help here? Why is cpan
prompt method is throwing that error? Next for tar file method if there is module dependency issue then how to resolve it using CPAN tar file method? Also how to install the modules on the correct path because I don't want to add all the required module's paths in @INC
path in the beginning of my script. I am a root user here.