in reply to The getpwuid function is unimplemented at C:/Perl/....
Near the top of my script I added the suggested ENV line:
$ENV(HOME) = "C:\\Perl\\myscripts\\etc";
This setting tells the script where to save your SHH settings. Run your script after that, and assuming no other problems are present, you'll see a directory named .shh in the directory you specified with the $ENV(HOME) setting. Look in that directory and you should find a file named something like known_hosts2. If you have all that, then you've solved the getpwuid function problem (and a few other related problems I'm guessing).
After setting that variable I was able to connect to an SFTP server and download a small file; however, the Net-Sftp page on cpan says that when you call "get" to retrieve a file that the $localfile setting is optional. I found that was not the case. I had to spell out completely the remote file I wanted and what I wanted to call it once it downloaded. Here's an example:
$remotefile = '/home/joe_user/addresses.txt'; $localfile = "C:\\temp\\addresses.txt"; $sftp->get($remotefile, $localfile);
When I didn't include the $localfile setting, I didn't get anything. Actually, I downloaded the file but it was never saved to any place I could fine. I know that was a simple illustration for most of the experienced Perl programmers that frequent this forum; however, for the casual Perl programmer, I probably just saved them a big headache. Enjoy and thanks to the previous comments that contained the solution. I only posted to add further clarity in hopes to help out others.
|
|---|