title: Net::SCP / Net::SCP::Expect - how to deal with password vs key authentication
body: <p>I have a script that works on different clients, and need to SCP files to different hosts. Depending on the combination of client &amp; server, I may need to use password authentication or public key authentication. I cannot really know in advance which one to use.</p>
  
  <p>There are 2 CPAN libraries for SCP that I use:</p>
  
  <ul>
  <li>Net::SCP: works with public key authentication only </li>
  <li>Net::SCP::Expect: works with password authentication only</li>
  </ul>
  
  <p>The problem is that neither library works for both authentications, and I don't know which one to use in advance. Do you know of any way to work with both authentication schemes?</p>