http://qs1969.pair.com?node_id=836829

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

hi all, I am automating few processes on linux machines. I first need to copy few scripts from windows machine to linux machine and then i need to run those scripts on that machines only to automate few things. what I was doing till now is remote login with ssh from windows machine and execute the script and manually copying the scripts to linux machine. Now I have built GUI for windows machine which gives user an option which action he wants to perform and accordingly it will perform some action on remote linux machine. User will give IP address and username-password. But due to remote login ,my GUI hangs. I mean it becomes sluggish and slow due to remote connection. I tried using Net::SSH::Perl module but as I am working behind proxy , my PPM is not able to connect to internet. So I am not able to install any module other than that came default. So all i do is again using system command and ssh to run remote perl scripts. Can anyone suggest what I can do to make my program's performance better?

Replies are listed 'Best First'.
Re: running remote perl scripts
by amedico (Sexton) on Apr 26, 2010 at 04:59 UTC
    Make your app asynchronous (such as by starting a thread, forking a process, or by using a GUI toolkit event system) so that the background task doesn't block the GUI.
Re: running remote perl scripts
by zer (Deacon) on Apr 26, 2010 at 03:33 UTC
    you could download the Net::SSH package and install it on your system. look here
      the solution given by you, i tried copying the files same way. but some of the directory format I am not able to understand neither it resembles to the directory tree in Net-SSH-Perl package. I am not sure what to do.
Re: running remote perl scripts
by VinsWorldcom (Prior) on Apr 26, 2010 at 12:57 UTC

    You mention PPM so I assume ActiveState on Windows. The proxy shouldn't cause you any issues - I'm behind a proxy and PPM works fine.

    You will need to set an environment variable with the proxy information.

    From the command line (cmd.exe)

    {C} > set http_proxy=http://proxy.server.com:8080

    Where

    http://proxy.server.com:8080
    is the address/hostname and port of your proxy server.

    To make this permanent - usable everytime you launch cmd.exe, use:

    1. Right-click "My Compter"
    2. Select "Properties" menu item
    3. Select "Advanced" tab
    4. Press "Environment Variables" button
    5. Under the "System Variables" section, press "New" button
    6. Enter "http_proxy" (without the double quotes) in the "Variable name" text box
    7. Enter the proxy server address/hostname and port from above in the "Variable value" text box
    8. Press "OK" button on the "New User Variable" window
    9. Press "OK" button on the "Environment Variables" window
    10. Press "OK" button on the "System Properties" window
      Great info! Sometimes some machines are not able to connect to the internet even via a proxy. This case is similar to a standalone machine. But there is still a way! Latest versions of ppm can install a *.ppd file. type: ppm help install at the command prompt for details. Basically if all else fails, get the appropriate .ppd file to the machine via "sneaker net" or whatever and use the command line install of that .ppd file.