in reply to Re: fork/exe, system open etc.
in thread fork/exe, system open etc.
system("perl script.pl >/dev/null &"); open(CMD, "|perl script.pl > /dev/null");
To illustrate that both the system and open methods will spawn a child process without blocking the parent, both of these scripts will continue to print "boo" even after the parent has exited:
system("while true; do echo boo; sleep 2; done &"); print "system done - exiting\n";
open(CMD, "|while true; do echo boo; sleep 2; done"); print "open returned - exiting\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: fork/exe, system open etc.
by almut (Canon) on May 02, 2008 at 20:04 UTC | |
|
Re^3: fork/exe, system open etc.
by martino (Initiate) on May 06, 2008 at 08:09 UTC |