Do you use login like:
$sftp = Net::SFTP::->new($host, %login)? I haven't ever used Net::SFTP, but from a quick glace at the source, it looks like
ssh_args => is supposed to be there and is supposed to be followed by an ref to an array containing extra parameters to put in the call to Net::SSH::Perl::->new. It's hard to see how what you have would work:
sub new {
my $class = shift;
my $sftp = bless { }, $class;
$sftp->{host} = shift;
$sftp->init(@_);
}
sub init {
my $sftp = shift;
my %param = @_;
$sftp->{debug} = delete $param{debug};
$param{ssh_args} ||= [];
$sftp->{_msg_id} = 0;
my $ssh = Net::SSH::Perl->new($sftp->{host}, protocol => 2,
debug => $sftp->{debug}, @{ $param{ssh_args} });
...
with no further use of @_ in init(). It looks like you want something like (completely untested):
$sftp = Net::SFTP::->new($host,
user => $username,
password => $password,
ssh_args => [
options => [
"StrickHostKeyChecking no"
]
]
);
Which is basically what the doc says, except that both modules say reference to a list where they mean reference to an array.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.