tags:

views:

144

answers:

2

I have a perl script i made to automatically telnet into different servers . but its interface is only command line. To make it more user friendly for general windows users , i need to make GUI for it .

My idea is to make GUI in a language like VB,java ,etc and let that call perl script . my script will run in background in a command prompt and whatever the result it displays back in GUI.

Got some success. GUI in vb ,I run an instance of CMD in background ,run perl script in that .But that is wer program fails .As perl script runs in a thread for perl , i only get the output when script completes(rather say when it timeout). i need a mechanism where i can interact with the perl script , take output of script and show to user , then take input from user and so on .

Please can you all suggest me some way to actually make this happen.

PS: No limitation on using any language for GUI (as core work is done by perl script,GUI only there to give appropriate commands to script)

Thanks in advance

+1  A: 

Take a look at Perl's Win32::GUI

Narthring
Or Tk, or Tkx, or Gtk, or Wx, or Prima...or just see http://www.perlmonks.org/?node_id=108708
runrig
Thank you for your reply .Though it needed a lot of work to do i finally managed to get the things done my way :) . For other curious people , i used "The GUI loft" to design my GUI . then Win32 API for handling events and all other GUI related things . Imported my original script in the program and works done .
Himz
nice link runrig
Himz
A: 

If you create your GUI in Java, one of the languages you suggested, you can run a perl script using the Runtime.exec() method. Here's the javadoc for the Runtime class.

As they suggest in the Sun forums, you have to execute the perl interpreter and pass the script as an argument. like "rt.exec("C:/perl.exe C:\runPerl.pl");".

In that forum, they also suggest looking at the following JavaWorld article. On page four of the article, DaConta gives a good demonstration of capturing output from the perl script, which I believe should suit your needs. Input works similarly, also using streams.

angstrom91
thanx looking at your method
Himz
Tried your method first . but got stuck in the same situation as the case was with my VB application-interacting with command prompt when script is running . tried win32::GUI after and that worked .thanx
Himz