Sys::Cmd

Run a system command or spawn a system processes
Download

Sys::Cmd Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Publisher Name:
  • Mark Lawrence
  • Publisher web site:
  • http://search.cpan.org/~mlawren/

Sys::Cmd Tags


Sys::Cmd Description

Run a system command or spawn a system processes 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) Requirements: · Perl


Sys::Cmd Related Software