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

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

Greetings wise ones. I am trying to set my display to a windows machine and then kick off a command and run it in the background on a solaris 8 machine. The code works fine as far as setting the display and starting the xterm goes but, drops the ball on putting the process in the background. Has anyone run into this problem and or found a solution? As always any help is greatly appreciated. Below is a simple example of what I am trying to do. The script fist starts exceed in passive mode to allow my display to be set.
use Net::SSH::W32Perl; $host = "$ARGV[0]"; $user = "$ARGV[1]"; $pwd = "$ARGV[2]"; $cmd = 'setenv DISPLAY 10.1.42.151:0.0; xterm &'; &startexceed; print "EXCEED STARTED\n"; my $ssh = new Net::SSH::W32Perl($host, protocol => '2', debug => + 1); $ssh->login($user, $pwd); my ($out, $err, $exit) = $ssh->cmd($cmd); print "OUT => $out\n\n"; print "ERR => $err\n\n"; print "EXIT => $exit\n\n"; sub startexceed{ $exceed = "C:\\Program Files\\Hummingbird\\Connectivity\\9.00\\Exc +eed\\exceed.exe"; use Win32::Process; $Result = Win32::Process::Create($ProcessObj, "$exceed", "$exceed -m passive", 0, NORMAL_PRIORITY_CLASS, ".")|| die "\nCould not create exceed\.exe\n"; $ProcessObj->Wait(10); $ProcessObj->GetExitCode($exitcode); unless($exitcode == "259"){ die "exceed exited with a return code of $exitcode\n"; } }