in reply to NET::SFTP::Foreign in perl

Just for the record:

This problem was caused by Net::SFTP::Foreign using a feature of IPC::Open3 not available from the old version of that module coming with perl 5.6.

Specifically, it does...

$my child = open2($in, $out, '-');
because of this: Expect and PTY dropping data.

A work around is now in place :-)

Replies are listed 'Best First'.
Re^2: NET::SFTP::Foreign in perl
by Anonymous Monk on Jul 22, 2009 at 07:08 UTC
    Dear salva,
    I too get this error - Password not requested as expected: -1

    I am using Perl 5.8.9 and have installed Net-SFTP-Foreign-1.53, Expect-1.21 and IO-Tty-1.07. When I try to pass the password in the code itself, I get this error.

    my $sftp = Net::SFTP::Foreign->new(abc@10.21.1.176', password => 'password', timeout => 300);

    I opened the file Foreign.pm and found a method ipc_open2_bug_workaround(). Looks like this subroutine was meant for fixing the bug explained. Any idea why I still get the error.

    Thanks in advance
      There was a regression on Net::SFTP::Foreign 1.53.

      The problem is solved in the new version 1.54_01 that I have just uploaded to CPAN.

        Dear Salva, Is there any way I can use Net::SFTP::Foreign (version 1.54) to connect to remote machine and then execute a shell script or any other command on the remote machine.

        I tried
        my $sftp = Net::SFTP::Foreign->new('user@10.21.1.176', password => $pass, open2_cmd => 'mkdir perl_sftp');

        But it gave me an error
        - Invalid option 'host' or bad combination of options at sftpCompatEx.pl line 21

        thanks
        Thanks a lot!