in reply to Perl script works differently from Apache then CMD line
Specifically the remote SSH server may not like having its stdin stream closed. Try redirecting it from a pipe:
pipe my($r_pipe), my($w_pipe); $ssh->capture({stdin_fh => $r_pipe}, ...);
|
|---|