To start with, perl exec is not going to return control to the calling program.
perldoc -f exec
exec LIST
exec PROGRAM LIST
The "exec" function executes a system command and
never returns-- use "system" instead of "exec" if
you want it to return. It fails and returns false
only if the command does not exist and it is
executed directly instead of via your system's
command shell (see below).
To spawn another process is quite easy in Perl. The following code will do what you want:
...
my $pid = fork();
if (undefined $pid) {
die 'Fork failed';
}
if (!$pid) {
# I am in the child process
system $MYCOMMAND;
exit;
}
# I am in the parent process
# continue with other business
...