I've never used Net::SFTP, but I have a few suggestions...
- 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.
- 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" ?
- Are you sure that the local file you want to put is "readable" by your local user?
- Are you sure that the remote directory you want to write to is "writable" by your remote user?
- Are you sure that your remote server supports SFTP?
- Have you tried something simpler then a put? like: print Dumper($sftp->ls('.')); ?
-
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.