Octavian Rasnita <[EMAIL PROTECTED]> wrote:
> 
> If I want to run a code in background, do I need to fork another
> program, or it is possible to fork a subroutine from the same 
> program that uses the fork function?
> 

You can do whatever you want in the child.

  defined (my $pid = fork) 
    or die "couldn't fork: $!";

  if ($pid == 0) {
    #
    # child does its stuff
    #

    exit;
  }

  # parent continues here


-- 
Steve

perldoc -qa.j | perl -lpe '($_)=m("(.*)")'

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to