Name : perl-Sys-Cmd
| |
Version : 0.82.0
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : 1.3
| Date : 2015-06-25 05:28:56
|
Group : Development/Libraries/Perl
| Source RPM : perl-Sys-Cmd-0.82.0-1.3.src.rpm
|
Size : 0.04 MB
| |
Packager : (none)
| |
Summary : run a system command or spawn a system processes
|
Description :
*Sys::Cmd* 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. The following functions are exported on demand by this module:
* run( AATTcmd, [\\%opt] ) => $output | AATToutput
Execute \'AATTcmd\' and return what the command sent to its \'STDOUT\', raising an exception in the event of error. In array context returns a list instead of a plain string.
The first element of \'AATTcmd\' will be looked up using the File::Which manpage if it doesn\'t exist as a relative file name is is a CODE reference (UNIX only). The command input and environment can be modified with an optional hashref containing the following key/values:
* dir
The working directory the command will be run in.
* encoding
An string value identifying the encoding of the input/output file-handles. Defaults to \'utf8\'.
* env
A hashref containing key/values to be added to the current environment at run-time. If a key has an undefined value then the key is removed from the environment altogether.
* input
A string which is fed to the command via its standard input, which is then closed.
* runx( AATTcmd, [\\%opt] ) => $outerrput | AATTouterrput
The same as the \'run\' function but with the command\'s \'STDERR\' output appended to the \'STDOUT\' output.
* spawn( AATTcmd, [\\%opt] ) => Sys::Cmd
Return a *Sys::Cmd* object (documented below) representing the process running AATTcmd, with attributes set according to the optional \\%opt hashref. The first element of the \'AATTcmd\' array is looked up using the File::Which manpage if it cannot be found in the file-system as a relative file name or it is a CODE reference (UNIX only).
*Sys::Cmd* objects can of course be created using the standard \'new\' constructor if you prefer that to the \'spawn\' function:
$proc = Sys::Cmd->new( cmd => \\AATTcmd, dir => \'/\', env => { SOME => \'VALUE\' }, enc => \'iso-8859-3\', input => \'feedme\', on_exit => sub { my $proc = shift; print $proc->pid .\' exited with \'. $proc->exit; }, );
Note that *Sys::Cmd* objects created this way will not lookup the command using the File::Which manpage the way the \'run\', \'runx\' and \'spawn\' functions do.
*Sys::Cmd* uses the Log::Any manpage \'debug\' calls for logging purposes.
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl:/CPAN-S/openSUSE_Tumbleweed/noarch |