title: PERL SFTP using System, Cannot install SFTP module
body: <p>I'm a bit new to perl and stackoverflow. If I could use a more familiar language I would, unfortunately I cannot due to certain circumstances. Thanks in advance for the help. </p>
  
  <p>Modules Not Installed: Net::SFTP, WWW::CURL, Net::SSH2, Net::SFTP::Foriegn
  Modules Installed: Net::FTP</p>
  
  <p>I am unable to install modules. </p>
  
  <p>Unable to use Net::FTP Tried Default port and port 22, with a username and password. All I get back from the other box's log when trying to connect is "Did not receive identification string from xx.xx.xx.xx" Also unable to use FTP in command line, times out. </p>
  
  <p><code>
  $ftp = Net::FTP->new($box,Port=>22, Debug => 0)<br />
     or die print "Error: Cannot connect";<br />
  $ftp->login($userBox,$passBox)<br />
     or die print "Error: Cannot login";<br />
  $ftp->cwd()<br />
     or die print "Error: Cannot change to Root";<br />
  $ftp->cwd($dir)<br />
     or die print "Error: Cannot change to selected directory";<br />
  if($copyfile ne "" &amp;&amp; $dir ne "")<br />
     {<br />
        $ftp->put($copyfile, $copyfile);<br />
     }<br />
  $ftp->quit();</code></p>
  
  <p>I can manually use SFTP through the linux command line, not FTP, so I have been trying to use the system command to SFTP into the other box. The other box's logs just say "Connection closed by xx.xx.xx.xx"</p>
  
  <p><code>
  system('sftp '.$userBox.'@'.$box.' ENDOFINPUT'<br />
  .$passBox.'ENDOFINPUT<br />
  cd ../../../<br />
  put '.$filename.' '.$dir.'<br />
  exit<br />
  ENDOFINPUT');</code></p>
  
  <p>If anyone knows how to help me with my problem that'd be great :) </p>