I
Icari
I am fairly new to Perl this being my first scripting project so I'm
still in my 'baby-talk' stage, but any suggestions/input would be most
helpful!
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:
#!/usr/local/bin/perl
use strict;
use Net::SFTP;
<$host, $user and $pass definined here>
my %args = (user => "$user", password => "$pass");
my $sftp = Net::SFTP->new($host, %args);
$sftp->put("testfile", "/var/tmp/remotetest");
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:
erl
pm file...
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
argument hash?
my %args = (user => "$user", password => "$pass", ssh_args => [port =>
22]);
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.
Thanks,
Icari.
still in my 'baby-talk' stage, but any suggestions/input would be most
helpful!
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:
#!/usr/local/bin/perl
use strict;
use Net::SFTP;
<$host, $user and $pass definined here>
my %args = (user => "$user", password => "$pass");
my $sftp = Net::SFTP->new($host, %args);
$sftp->put("testfile", "/var/tmp/remotetest");
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:
pm file...
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
argument hash?
my %args = (user => "$user", password => "$pass", ssh_args => [port =>
22]);
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.
Thanks,
Icari.