Discussion Locked

System call to GUI executable from perl

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am trying to run a system command to a GUI program from within a perl script WITHOUT waiting for the called program to complete. I have tried numerous combinations of `cmd start GUIcommandbeingcalled` without success--I can't get the program to start without the perl script waiting for it to complete--which I don't want to do--I just want to know that it got started successfully. I can run a "start GUICommandbeing called" just fine from a Windows CMD window but not from perl. I've tried system calls and backticks, which should be the same, but without success.

This should be easy, right!

Thanks for any help

7 replies

by mike_dietz

You can use the exec command, which will start the gui program and never return.

If you want to continue execution of the PERL script you could build a batch file by opening a file, printing the batch statements to the file, then use the systemcommand to run the batch file. The start command does not wait for the executable to finish before continuing.

by soxman

As a followup to my original question:
1. cmd /c doesn't do it
2. exec isn't what I want since it forks a new process and never returns to the calling perl.
3. I ended up using a perl module, Win32:Process, to create and follow the routine I needed. It's not exactly what I want but the best I could find. Wonder if anyone has done something like this too and can offer some lessons learned.

This discussion is closed to new replies.