in reply to Perl Background processes in Windows
You'd call this the same way you'd call system, except now it forks a new process before running the first arg.sub run_in_bg { my $pid = fork; die "Can't fork a new process" unless defined $pid; # child gets PID 0 if ($pid == 0) { exec(@_) || die "Can't exec $_[0]"; } # in case you wanted to use waitpid on it return $pid; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl Background processes in Windows
by chaos_cat (Scribe) on Jan 18, 2008 at 23:11 UTC |