0
votes

When I use transport API of Net::SFTP::Foreign to connect to remote server on windows, It reports error

"Invalid option 'host' or bad combination of options" after Net::SFTP::Foreign->new is invoked

code is below:

pipe $pR,$pW;
  $sftp = Net::SFTP::Foreign->new("$user\@$ip",transport=>[$pR,$pW]) or 
  $rdyTCE{$city1} = 1;
1
plink method can work now. but transport still cannot work after more tries - user6112709

1 Answers

0
votes

According to module documentation available on CPAN: http://search.cpan.org/~salva/Net-SFTP-Foreign-1.81/lib/Net/SFTP/Foreign.pm#API

transport => [$in_fh, $out_fh, $pid]
allows one to use an already open pipe or socket as the transport for the SFTP protocol.

So you don't need host. Pipes will be used.