in reply to Calling a remote ssh connection from perl
In addition to what LanX said, system doesn't capture the output of the command. I very strongly recommend you use Net::OpenSSH instead. (And as for running external commands, see Calling External Commands More Safely.)
Update: You've replaced your question with a different one. Please read It is uncool to update a node in a way that renders replies confusing or meaningless.
In Section
Seekers of Perl Wisdom