in reply to Re: Remote Session Starting
in thread Remote Session Starting

So here is some of the code to do the exporting of the session, I am using Net::Telnet to get to the Unix Server:


my($session);
$session = new Net::Telnet
(
Timeout => 10,
Prompt => $prompt
);

$session -> input_log($logFileName);
$session -> open($host);
$session -> login($username, $password);

$session -> cmd("export DISPLAY=$ADDRNUM:0.0");
print( STDOUT "Starting X-Motif GUI xrel in background mode\n" );
$session -> cmd("xrel&");
sleep 5;

Replies are listed 'Best First'.
Re^3: Remote Session Starting
by Anonymous Monk on Feb 28, 2008 at 22:53 UTC
    I am not sure how to operate on the GUI while in $session as the commands in Net::Telnet do not look like what I might need or want.

    If I get rid of the sleep the session goes away.
      If I get rid of the sleep the session goes away.
      Erm, that wouldn't be because that's the end of the script, which would close the telnet session and disconnect the programs? Can't you just start your Win32::GuiTest code right where you now have the sleep?

      update: IIRC, if you let the $session variable go out of scope (or otherwise overwrite it) that would close the session too. As far as I can see, you only have to make sure the $session variable (and with it, the session) is kept as is while you carry out whatever tasks you need.

      update2: s/$telnet/$session/

        I did try the WIn32::GUITest in place of the sleep but the session went away.

        Based on what you have said about keeping the session in scope is more than likely the probelm but I am not sure how to do this, a failing on my part to really understanding variable scoping.