G'day zn553,
Welcome to the Monastery.
As I can see no other mention of it, I thought I'd point out that your first statement has:
... key_path= $private_key_path, ...
Here's how Perl sees that statement:
$ perl -MO=Deparse,-p -e 'my $ssh = Net::OpenSSH->new($host, user => $
+user, master_opts => ["-vvv"], key_path= $private_key_path, default_s
+sh_opts=>[-o =>"Port=24"]);'
Can't modify constant item in scalar assignment at -e line 1, near "$p
+rivate_key_path,"
-e had compilation errors.
(my $ssh = 'Net::OpenSSH'->new($host, 'user', $user, 'master_opts', ['
+-vvv'], ('key_path' = $private_key_path), 'default_ssh_opts', [(-'o')
+, 'Port=24']));
Changing '=' to '=>':
$ perl -MO=Deparse,-p -e 'my $ssh = Net::OpenSSH->new($host, user => $
+user, master_opts => ["-vvv"], key_path=> $private_key_path, default_
+ssh_opts=>[-o =>"Port=24"]);'
(my $ssh = 'Net::OpenSSH'->new($host, 'user', $user, 'master_opts', ['
+-vvv'], 'key_path', $private_key_path, 'default_ssh_opts', ['-o', 'Po
+rt=24']));
-e syntax OK
This comment is not intended to invalidate other responses.
However, as you've shown no surrounding code
— which could perhaps capture the error in an eval, or similar, block —
nor any error or warning output,
this may be an additional problem you'll need to address.
If you're unfamiliar with the code I've used, take a look at B::Deparse;
and, in case you need it, perlrun has more information on
Command Switches.
|