Re: NET::SFTP::Foreign in perl
by Khen1950fx (Canon) on Jun 13, 2009 at 23:07 UTC
|
I cleaned it up a little, then I tried this:
#!/usr/bin/perl
use strict;
use warnings;
use Net::SFTP::Foreign;
my $sftp = Net::SFTP::Foreign->new(
'user@localhost',
password => 'password',
more => ['-v']
);
$sftp->get('/remote/Desktop/copy', '/home/user/Desktop/copy')
or die "unable to retrieve copy: ".$sftp->error;
This worked for me. | [reply] [d/l] |
Re: NET::SFTP::Foreign in perl
by Anonymous Monk on Jun 13, 2009 at 08:40 UTC
|
| [reply] |
|
my $sftp = Net::SFTP::Foreign->new('vetri@hostname' ,password => '****
+*' ,expect_log_user => 1,time
out => 8,more => '-v' ) ;
the below code is not working . I got same error .
The used Net-SFTP-Foreign-1.51 version . The server is running .
| [reply] [d/l] |
|
Hi, I am the author of Net::SFTP::Foreign, your problem seems to be caused by a bug there so could you post (or if you prefer, sent me be email) the working and the non-working scripts?
Also, set $Net::SFTP::Foreign = -1; at the beginning, rerun them and include the generated debugging information, please.
| [reply] [d/l] |
|
|
Re: NET::SFTP::Foreign in perl
by salva (Canon) on Jun 26, 2009 at 11:12 UTC
|
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 :-) | [reply] [d/l] |
|
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
| [reply] |
|
| [reply] |
|
|
|
|
|
Re: NET::SFTP::Foreign in perl
by Anonymous Monk on Jul 15, 2019 at 21:24 UTC
|
Hi,
Please, i need your Help.
I have installed perl 5.12 and NET::SFTP::Forgein 1.87.
</The message error is failed with exitcode=255_ENDL_stderr= object version 2.42 does not match bootstrap parameter %_ at /usr/perl5/site_perl/5.12/i86pc-solaris-64int/XSLoader.pm line 91._ENDL_Compilation failed in require at /usr/perl5/site_perl/5.12/Net/SFTP/Foreign.pm line 19._ENDL_BEGIN failed--compilation aborted at /usr/perl5/site_perl/5.12/Net/SFTP/Foreign.pm line 30.>
In the version perl 5.8.4 and NET::SFTP::Forgein 1.87 itīs OK.
Do you know some change??
| [reply] |
|
object version 2.42 does not match bootstrap parameter .... Compilation failed in require at /usr/perl5/site_perl/5.12/Net/SFTP/Foreign.pm line 19
Seems to be a very garbled output that you've got there.
"Line 19" (though I think it's actually line 20) of Foreign.pm is require Encode;
Somewhere in your upgrade it would seem that Encode has not been updated correctly. The version of the compiled element of Encode (ie the "object version") is at version 2.42, while Encode.pm itself is apparently at some different version.
What does the following one-liner output:
perl -le 'require Encode;'
If that produces an "object version 2.42" error, then try installing Encode again - and get back to us again if that doesn't fix the error.
(Of course, also let us know if the above one-liner worked fine - in which case there will have been no output, and the solution to your problem requires further thought.)
Update: If you do need to post again, please provide output of perl -V
Cheers, Rob
| [reply] [d/l] [select] |
|
While "reinstall Encode" is one approach to a solution, if the OP actually has two versions of Perl installed (5.8 and 5.12) and wants to keep both, they should instead make sure that the Perl versions get separate module directories. But if 5.8 is gone, then simply overwriting should work.
| [reply] |