Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Net::SFTP ssh_args=>[ ] syntax question...
August 19, 2004, 1:48 pm
rate this thread
but please help or at least let me know where I should post for
There's an example psftp script in the Net::SFTP module directory
which defines the following argument hash to pass into sftp:
my %args = (ssh_args => ); # from the perl man pages, it looks like
# ssh_args can be any arguments
# accepted by Net::SSH, so I guess
# I can put a hash list within
# a hash?
I wasn't able to run that script cleanly to test if my Net::SFTP
module was installed correctly so I wrote a smaller script to test:
<$host, $user and $pass definined here>
my %args = (user => "$user", password => "$pass");
my $sftp = Net::SFTP->new($host, %args);
When I ran my transfer program, it exits with a complaint that it does
not know what port 'ssh' is and made reference to the Net::SSH::Perl
I added ssh port 22 in my /etc/services file to temporarily fix this,
but I am really curious as to how I can define the ssh port within my
my %args = (user => "$user", password => "$pass", ssh_args => [port =>
Is the above right? I don't see the [ ] signs used too often outside
of pattern class definitions, the only time I saw this was with slices
so I'm not sure what the correct way to input additional ssh arguments
into the ssh_args option.