On Sep 21, Jonathan Howe said:
>Is it possible when making a call to the system, using the system
>command our back ticks to have a script exit/finish with out hanging
>around for a return from the process handed to the system.
You need to fork a new process.
if ($pid = fork) {
print "child ($pid) is doing his own thing.\n";
exit;
}
elsif (defined $pid) {
# I'm the child
exec "someprocess", @args;
die "couldn't exec someprocess @args: $!";
}
else {
die "fork failed: $!";
}
The exec() function replaces the current process with a new one, so the
die "couldn't exec..." line should only be reached if exec() fails.
For more, check up on:
perldoc -f fork
perldoc -f exec
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]