sub executeCommand{ my $command = join ' ', @_; $prot and print("Command: $command\n"); my $response = qx($command 2>&1); my $status = $? >> 8; return ($status, $response); } my @src_cmd = ('ssh.exe ', $ssh_user.'@'.$hostname ." /fullpath/check_user_exists.pl " . "$user"); my ($status, $output) = &executeCommand(@src_cmd);