Then -- with the caveat that I don't have a non-Windows system to hand to test this -- make the changes in main before you spawn the thread. Eg:
{ my $running : shared = 0; local %ENV = %ENV; $ENV{ FOO } = 'BAR'; async{ my $pid = open ...; $running = 1; ... kill ... }->detach; ## Wait until the kid is spawned before exiting the scope. sleep 1 until $running; } ## And repeat till done.
In reply to Re^3: Get the process id, and output of a process, in a threaded environment
by BrowserUk
in thread Get the process id, and output of a process, in a threaded environment
by rmahin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |