Sys::Cmd 0.08
Sys::Cmd is a Perl module that lets you run system commands and capture their output, or spawn and interact with a system process through its STDIN, STDOUT, and STDERR file handles.
SYNOPSIS
use Sys::Cmd qw/run spawn/;
# Get command output, raise exception on failure:
$output = run(@cmd);
# Feed command some input, get output as lines,
# raise exception on failure:
@output = run(@cmd, { input => 'feedme' });
# Spawn and interact with a process with special environment:
$proc = spawn( @cmd, { dir => '/' , encoding => 'iso-8859-3'} );
while (my $line = $proc->stdout->getline) {
$proc->stdin->print("thanks");
}
my @errors = $proc->stderr->getlines;
$proc->close(); # Done!
# read exit information
$proc->exit(); # exit status
$proc->signal(); # signal
$proc->core(); # core dumped? (boolean)
Product's homepage
Requirements:
Ссылка:
Новые:
|
Рейтинг за сегодня::
|
Похожие:
|