my $out = `$command`; # $out contains the command stdout my $rc = $? >> 8; # $rc contains command return code