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

gabrielsousa has asked for the wisdom of the Perl Monks concerning the following question:

how to i get STDERR from this ?

open(SSH,"sshpass -p $pass ssh user\@$ip $cmd |") || die "$!\n";
@result= <SSH>; chomp @result;
close SSH;