No such thing as a small change | |
PerlMonks |
Re^2: Second background process is pausing the guiby bliako (Monsignor) |
on Jun 11, 2020 at 10:59 UTC ( [id://11117937]=note: print w/replies, xml ) | Need Help?? |
It will be asynchronous in the sense that the command output can be read while it is being executed (as a child process). Otherwise it is synchronous in the sense that you can't move outside the scope of the filehandle $xx without explicitly killing the child. This is the normal usage based on "Perl Cookbook"'s "16.4. Reading or Writing to Another Program" (edit: sorry for pirated link! I did not know, thanks Fletch)
The following code demonstrates what I mean by "outside the scope of the filehandle". At the goto it waits for the spawned command to be finished:
You will notice that "here" is printed only upon script exit. Whereas, the following executes the goto because it is within scope but script does not exit until sleep exits. Perhaps half-asynchronously would be a better term ;)
"here" is printed at the goto, then there is implicit waiting for sleep to end. bw, bliako
In Section
Seekers of Perl Wisdom
|
|