http://www.perlmonks.org?node_id=1007498


in reply to Need Help in NET::SSH::Perl to fetch the status of remote pid

I tried it on my system. It works for me; however, I did it a little differently:
#!/usr/bin/perl -l use strict; use warnings; use Net::SSH::Perl; my $host = 'xl-blr-03.ban'; my $user = 'mcsi_user'; my $password = 'password'; my $cmd = system("kill 0 28075; echo $?"); my $ssh = Net::SSH::Perl->new($host, debug => 1); $ssh->login($user, $password); my($stdout, $stderr, $exit) = $ssh->cmd($cmd);