#!/usr/bin/perl -w use strict; my $pid = fork(); if ($pid == 0) { # This is the child process. # exec() the external program. exec("my_program") or die "could not exec my_program: $!"; } elsif (!defined($pid)) { die "could not fork"; } # Everything below here is the parent process print "This is the parent process\n";
-Matt
In reply to Re: Starting a process in the background that lives after perl dies.
by DrManhattan
in thread Starting a process in the background that lives after perl dies.
by ehdonhon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |