system("command &"); #### my $pid; if (defined ($pid=fork)) { if (!$pid) { # Execute command in the child exec ("command"); # If it returns, there was an error die "Error executing command: $!\n"; } # The parent continues unaffected, falls of the if stmt } else { die "Error in fork: $!\n"; }