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
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:
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.
The last message is the one I do not know what to do with.
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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.