kevind0718 has asked for the wisdom of the Perl Monks concerning the following question:
Hello Kind and Wise Monks:
I have some scripts working which download files off a FTP site. Given that these scripts are working the site is being upgraded to SFTP. Happy Happy.
I am attempting to use Net::SFTP to do these simple down loads. I can retieve he files using Filezilla, so I know I have the correct logon info.
Please take a look at the following code
When run, this code produces the following error:
I am using Active Perl 5.8.8 and I downloaded the Net::SFTP package from TheoryX5 Win32 PPM packages. I am running under windows 2000
many thanks for your help
kd
I have some scripts working which download files off a FTP site. Given that these scripts are working the site is being upgraded to SFTP. Happy Happy.
I am attempting to use Net::SFTP to do these simple down loads. I can retieve he files using Filezilla, so I know I have the correct logon info.
Please take a look at the following code
use Net::SFTP; $SFTPSite = 'sftp.xxxxbroker' ; $userid = 'fred'; $pword = 'bedrock'; #** ** ** ** ** ** ** ** # Setup to do the SFTP $sftp = Net::SFTP->new( $SFTPSite, $userid, $pword ) or die "Could NOT create SFTP " ; #Net::SFTP const +ructor @entries = $sftp->ls('/'); # slurp all entries into an array foreach $entry (@entries) { print "$entry \n"; chomp $entry; my @fields = split /\s+/, $entry; print "the file name: " . $fields[-1] . "\n"; }
When run, this code produces the following error:
The last message is the one I do not know what to do with.Name "main::pword" used only once: possible typo at testSFTP.pl line 9 +. Name "main::userid" used only once: possible typo at testSFTP.pl line +8. The getpwuid function is unimplemented at c:/progFiles/PERL/site/lib/N +et/SSH/Per l.pm line 110.
I am using Active Perl 5.8.8 and I downloaded the Net::SFTP package from TheoryX5 Win32 PPM packages. I am running under windows 2000
many thanks for your help
kd
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: help with Net::SFTP
by andyford (Curate) on Jan 15, 2008 at 17:51 UTC | |
by kevind0718 (Scribe) on Jan 15, 2008 at 18:49 UTC | |
by andyford (Curate) on Jan 15, 2008 at 19:23 UTC | |
by Anonymous Monk on Jan 15, 2008 at 20:21 UTC | |
by salva (Canon) on Jan 16, 2008 at 15:30 UTC | |
by Anonymous Monk on Feb 11, 2008 at 10:04 UTC | |
|
Back to
Seekers of Perl Wisdom