in reply to Cancel a batch file ran by a thread from main

Take my advice this time :) really Re: Run a batch file and wait for it to finish
  • Comment on Re: Cancel a thread running a batch file from main

Replies are listed 'Best First'.
Re^2: Cancel a thread running a batch file from main
by rezeile008 (Sexton) on May 09, 2014 at 08:35 UTC
    Hi, firstly thanks for your support regarding my thread issues. :) I was not able to try out the Proc::Background method cause our active state version does not have this package by default. (well i can download it i know, but as other people might try to run this code, i figured i'd stick to the common packages). Anyway, I looked at your thread though and tried the queuing and seems like it's the (thread-safe) way to go and is a much better design, but I still end up with the same problem. Though now i think I found something is wrong with my question, it should have read "Cancel the BATCH file executed by a system call from a thread in main." pardon my mistake. any thoughts?
Re^2: Cancel a thread running a batch file from main
by Anonymous Monk on May 09, 2014 at 07:13 UTC
    my @jobs ; ... push @jobs, Proc::Background->new( $command, $arg1, $arg2 ); ... $jobs[0]->die if $jobs[0]->alive;