Thanks for the suggestion. This module seems to have a lot of functionality, so I definitely thought the try worth the effort. I'm calling it differently now and get a different error:
Permission denied (publickey,password). object created, back in main
sub get_ftp_object{ use strict; use Net::SFTP::Foreign; use 5.01; my $sub_hash = "my_sftp"; my $domain = $config{$sub_hash}->{'domain'}; my $username = $config{$sub_hash}->{'username'}; my $password = $config{$sub_hash}->{'password'}; my $port = 22; #dial up the server say "values are $domain $username $password"; my $sftp = Net::SFTP::Foreign->new( $domain, user => $username, port => $port, password => $password) or die "Can't connect: $!\n"; return $sftp; }
I seem to have gotten farther but don't understand why I didn't die here, as execution goes back to main. (?)
In reply to Re^2: instantiating an SFTP object
by Aldebaran
in thread instantiating an SFTP object
by Aldebaran
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |