title: Upload file over SFTP with Net::SFTP::Foreign
body: <p>I have a file <code>Test1.csv</code> on my local machine. I have a Perl script to copy this file to a remote location (<code>home/inbound</code>) through an SFTP connection.</p>
  
  <p>Below is my code</p>
  
  <pre><code>use Net::SFTP::Foreign;
  
  use warnings;
  use strict;
  
  my $host = "sftp.abcd.com";
  my $sftp = Net::SFTP::Foreign-&gt;new($host, user =&gt; 'user10524', password =&gt; 'XXXX');
  $sftp-&gt;error and die "Something bad happened: " . $sftp-&gt;error;
  
  $sftp-&gt;put("Test1.csv", "/inbound") or die "put failed: " . $sftp-&gt;error;
  </code></pre>
  
  <p>But I am getting this error, when I run the program:</p>
  
  <blockquote>
    <p>put failed: Couldn't open remote file '/inbound': No such file</p>
  </blockquote>