System::Command

Object for running system commands
Download

System::Command Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Philippe Bruhat
  • Publisher web site:
  • http://search.cpan.org/~book/

System::Command Tags


System::Command Description

System::Command is a Perl class that launches external system commands and return an object representing them, allowing to interact with them through their STDIN, STDOUT and STDERR handles.SYNOPSIS use System::Command; # invoke an external command, and return an object $cmd = System::Command->new( @cmd ); # options can be passed as a hashref $cmd = System::Command->new( @cmd, \%option ); # $cmd is basically a hash, with keys / accessors $cmd->stdin(); # filehandle to the process' stdin (write) $cmd->stdout(); # filehandle to the process' stdout (read) $cmd->stderr(); # filehandle to the process' stdout (read) $cmd->pid(); # pid of the child process # find out if the child process died if ( $cmd->is_terminated() ) { # the handles are not closed yet # but $cmd->exit() et al. are available } # done! $cmd->close(); # exit information $cmd->exit(); # exit status $cmd->signal(); # signal $cmd->core(); # core dumped? (boolean) # cut to the chase my ( $pid, $in, $out, $err ) = System::Command->spawn(@cmd);Product's homepage


System::Command Related Software