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

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.

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

Replies are listed 'Best First'.
Re^3: SYSTEM Call of PERL hangs application when running a TCL script
by Anonymous Monk on Jun 17, 2013 at 10:46 UTC

    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.

        Ok, so test.exe is doing something you don't want -- not much you can do about it from perl

        You can use Proc::Background to attempt to determine when it has hanged , and kill it if its been too long, instead of manually killing it, other than that, I've got no recommendations (debug test.exe sounds, well , like it sounds):)