in reply to Net::OpenSSH failing in unexpected way
Could you reduce this to an SSCCE?
Could it perhaps be a strange shell quoting issue? Have you tried turning on Net::OpenSSH's debugging, e.g. $Net::OpenSSH::debug |= 16; for debugging remote command execution?
Also, you might be able to reduce issues with quoting by making use of the quoting that is built into the module, and breaking the command into an array, e.g. ->capture(\%opts, 'perl', '-e', qq{print (-d '/directory/')}); (untested Update: tested, and I also wanted to suggest ->capture('perl','-e',q{print -d q{/directory/}}) instead).
If it really is a shell quoting issue, then sending Perl scripts to the remote side via perl -e might not be the best option in general. You could write a short script to run on the server side and then SCP it over to run it there.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Net::OpenSSH failing in unexpected way
by nysus (Parson) on Apr 04, 2017 at 17:23 UTC |