Matt S Trout > IPC-Command-Multiplex-0.008001 > IPC::Command::Multiplex

Download:
IPC-Command-Multiplex-0.008001.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.008001   Source  

NAME ^

IPC::Command::Multiplex - run commands in parallel

SYNOPSIS ^

  multiplex(
    run => [
      [ 'command1', 'arg1', 'arg2', 'arg3' ],
      [ 'command2', 'arg1', 'arg2', 'arg3' ],
      ...
    ],
    callback => sub {
      chomp(my $line = shift);
      # do something with $line here
    }
  );

DESCRIPTION ^

A simple way to run multiple commands (forking for each one) and get each line returned from them to a callback as they get sent.

Useful for aggregating log analysis and similar.

Currently using POE - this should be considered an implementation detail and may change - if this detail "leaks", i.e. you have to care about it when using this module, please file a bug.

Yes, this code is horribly new and could do with lots more examples. Try it out, email to complain, or send me some!

AUTHOR ^

Matt S Trout (mst) - <mst@shadowcat.co.uk>

CONTRIBUTORS ^

None as yet. Maybe this module is perfect ... (insert laughter here)

COPYRIGHT ^

(c) 2010 the IPC::Command::Multiplex "AUTHOR" and "CONTRIBUTORS" as listed above

LICENSE ^

This library is free software under the same terms as perl itself

syntax highlighting: