John M. Redford > Proc-Spawn > Proc::Spawn

Download:
Proc-Spawn-1.03.tar.gz

Dependencies

Annotate this POD

Related Modules

IO::React
IPC::Run
IO::Handle
IPC::Open2
IPC::Open3
Net::Telnet
File::Tail
IO::Tty
Win32::Process
more...
By perlmonks.org
View/Report Bugs
Module Version: 1.03   Source  

NAME ^

Proc::Spawn - Run external programs

SYNOPSIS ^

  use Proc::Spawn;

  my ($pid, $in_fh, $out_fh, $err_fh) = spawn("...");
  my ($pid, $in_fh, $out_fh, $err_fh) = spawn(["...", ...]);

  my ($pid, $pty_fh) = spawn_pty("...");
  my ($pid, $pty_fh) = spawn_pty(["...", ...]);

DESCRIPTION ^

Proc::Spawn runs external programs, like ls and telnet. The process id of the spawned programs and IO::Handle objects are returned.

The spawn function should be used for most purposes. It returns three IO::Handle objects for stdin, stdout, and stderr of the program being run. This is sufficient for running nearly all programs, and does not consume significant operating system resources.

The spawn_pty function should only be used when running a program that opens /dev/tty to communicate. Examples of such programs are telnet and passwd. This function returns a single IO::Handle object that must be used for all input and output for the program.

ERRORS ^

The module will die on errors.

NOTES ^

This module is UNIX oriented. Functionality on other systems may vary.

AUTHOR ^

John Redford, John.Redford@fmr.com

SEE ALSO ^

IO::Handle

syntax highlighting: