in reply to Net::SFTP Help

I've never used Net::SFTP, but I have a few suggestions...
  1. When posting to PerlMonks, in addition to posting a complete sample program demonstrating your problem, you should post the exact error message you are getting.
  2. I don't see anything in the docs for Net::SFTP (v0.05) that says put will return true on success. Are you sure the copy isn't working just fine, and the only problem is that you are calling "die" ?
  3. Are you sure that the local file you want to put is "readable" by your local user?
  4. Are you sure that the remote directory you want to write to is "writable" by your remote user?
  5. Are you sure that your remote server supports SFTP?
  6. Have you tried something simpler then a put? like: print Dumper($sftp->ls('.')); ?
  7. Net::SFTP comes with a sample program called "psftp" that provides an interactive SFTP shell .. you should try using that to send your file once. If that works, then maybe you can dig into it's code to see what it does that you aren't.

Replies are listed 'Best First'.
Re: Re: Net::SFTP Help
by sebawllc (Initiate) on Apr 09, 2003 at 13:50 UTC
    Very good point. The error I am getting when debug is on is that it can't open the remote directory to write to it. -- This is puzzling, because I can sftp to the directory and send the files by hand.
    I am logged in locally to the machine to look at it. I have tried opening the directory with $sftp->open($path) but nothing from a remote standpoint seems to work.
    I didn't know about the psftp but will try it. Thanks.