The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

POSIX::RT::Spawn - Perl interface to the posix_spawn function

SYNOPSIS

    use POSIX::RT::Spawn;

    my $pid = spawn 'command', 'arg1', 'arg2'
        or die "failed to spawn: $!";
    waitpid $pid, 0;

DESCRIPTION

The POSIX::RT::Spawn module provides an interface to the posix_spawn(2) function for creating new processes.

FUNCTIONS

spawn

    $pid = spawn 'echo', 'hello world'

Does exactly the same thing as system LIST, except the parent process does not wait for the child process to exit. Also, the return value is the child pid on success, or false on failure.

See "system" in perlfunc for more details.

SEE ALSO

http://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_spawn.html

TODO

  • Allow the user to alter posix_spawn settings using package variables, e.g. $POSIX::RT::Spawn::Flags{RESETIDS} = 1 or $POSIX::RT::Spawn::Flags |= &POSIX_SPAWN_RESETIDS

  • Allow the user to lexically replace the ops that use fork/exec (e.g. backticks, open, system) with versions that use posix_spawn.

REQUESTS AND BUGS

Please report any bugs or feature requests to http://rt.cpan.org/Public/Bug/Report.html?Queue=POSIX-RT-Spawn. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc POSIX::RT::Spawn

You can also look for information at:

COPYRIGHT AND LICENSE

Copyright (C) 2011-2012 gray <gray at cpan.org>, all rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

gray, <gray at cpan.org>