IPC::Exe

Execute processes or Perl subroutines & string them via IPC. Think shell pipes.
Download

IPC::Exe Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Gerald Lai
  • Publisher web site:
  • http://search.cpan.org/~glai/

IPC::Exe Tags


IPC::Exe Description

Execute processes or Perl subroutines & string them via IPC. Think shell pipes. IPC::Exe is a Perl module written to provide a secure and highly flexible way to execute external programs with an intuitive syntax. In addition, more info is returned with each string of executions, such as the list of PIDs and $? of the last external pipe process (see "RETURN VALUES"). Execution uses exec command, and the shell is never invoked.The two exported subroutines perform all the heavy lifting of forking and executing processes. In particular, exe( ) implements the KID_TO_READ version of http://perldoc.perl.org/perlipc.html#Safe-Pipe-Openswhile bg( ) implements the double-fork technique illustrated at http://perldoc.perl.org/perlfaq8.html#How-do-I-start-a-process-in-the-background?SYNOPSIS use IPC::Exe qw(exe bg); my @pids = &{ exe sub { "2 >#" }, qw( ls /tmp a.txt ), bg exe qw( sort -r ), exe sub { print " 2nd cmd: @_\n"; print "three > $_" while < STDIN > }, bg exe 'sort', exe "cat", "-n", exe sub { print "six > $_" while < STDIN >; print " 5th cmd: @_\n" }, };is like doing the following in a modern Unix shell: ls /tmp a.txt 2 > /dev/null | { sort -r | | { sort | cat -n | } & } &except that is really a perl child process with access to main program variables in scope. Requirements: · Perl


IPC::Exe Related Software