As haukex mentioned, you probably should be using a module for the SSH connection. Two recent questions suggest that Net::SSH::Perl might be useful and give both some pitfalls and solutions.
Further, the SSH configuration you describe does not do what you seem to think that it does — the user account that you have created can get a shell with "ssh user@remotehost.com /bin/sh". You need to use the "forced command" option with the public key registered on the remote machine to ensure that that key can only be used to run your program, and you really need to read perlsec if that remote program is written in Perl and make sure that it cannot be abused to gain a shell if you do not want shell access to be available.
Lastly, one big difference between running ssh on a terminal and on pipes is whether SSH sets up a pty on the remote machine by default. Try "ssh -tt user@remotehost.com" instead if you insist on using IPC::Open3 for this.
In reply to Re: Problem executing command via ssh
by jcb
in thread Problem executing command via ssh
by mgalindez
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |