The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Run - Perl extension for to start programs in background

SYNOPSIS

  use Run;
  $pid = spawn 'long_running_task', 'arg1', 'arg2' or die "spawn: $!";
  do_something_else();
  waitpid($pid,0);

DESCRIPTION

The subroutine spawn is equivalent to the builtin system (see "system LIST" in perlfunc) with the exceptions that the program is started in background, and the return the pid of the kid.

Returns 0 on failure, $! should contain the reason for the failure.

EXPORT

Exports spawn by default.

AUTHOR

Ilya Zakharevich <ilya@math.ohio-state.edu

TODO

What to do with errs in or? Should they be cleared?

ENVIRONMENT

PERL_RUN_DEBUG is used to set debugging flag.

NOTES

open FH, ">&=FH1" creates a "naughty" copy of FH1. Closing FH will invalidate FH1.

SEE ALSO

perl(1).