my $ssh = Net::SSH::Perl->new($host,protocol=>2, interactive=>1);
$ssh->login($user, $pass, 1);
my $cmd = 'some_command ' . $cmd_opt;
my($stdout, $stderr, $exit) = $ssh->cmd($cmd);
print "OUT:$stdout\n ERR:$stderr\n EXIT:$exit\n";
####
OUT: First Line
ERR:
EXIT:0
####
bash$ cmd opt
First Line
Second Line
bash$