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.
In reply to Re: Net::OpenSSH failing in unexpected way
by haukex
in thread Net::OpenSSH failing in unexpected way
by nysus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |