in reply to SYSTEM Call of PERL hangs application when running a TCL script

The TCL script contains windows command typeperf.exe & , which runs in background of the application

windows doesn't work like that, it doesn't run in the background, see Proc::Background

  • Comment on Re: SYSTEM Call of PERL hangs application when running a TCL script

Replies are listed 'Best First'.
Re^2: SYSTEM Call of PERL hangs application when running a TCL script
by kalama (Initiate) on Jun 17, 2013 at 10:37 UTC

    Well , I am using following command in TCL :- exec typeperf -cf input.txt -si 1 -o output.txt & Now if i run the TCL script individually by in my application it works. Now i want to automate this process for executing multiple such scripts for which i am trying to use perl.

      and then what happened?

      You say SYSTEM Call of PERL hangs application when running a TCL script

      hang means it doesn't run in the background

      If you want to run it in background use Proc::Background

        Ok, i will be a more descriptive this time ...

        Say my application name is test.exe.
        To run the application i use input1.tcl.

        When i run the application individually using tcl , I can see from task manager of windows that test.exe is running and once my tcl completes , the .exe file is killed.

        This input1.tcl also contains typeperf command running in background as mentioned below. Once the TCL is run . i kill the typeperf forcibly using "exec TASKKILL typeperf.exe" written at the end of input1.tcl.

        Now i have multiple such TCL's which i have run on same test.exe. I am writing something like below :-
        foreach $tcl (list_of_tcls)
        {
        system ("test.exe", "TCL:$tcl" );
        }
        What this is doing is that i invokes a new process for test.exe on every iteration. Once the tcl is complete , it automatically terminate the test.exe.
        But after few iterations , i can see that test.exe has begun to run , but it is not completing its execution. test.exe just sits there (this is what i meant by hang).
        I forcibly kill the process from task manager , and then the perl again starts the scripts from last iteration.