Compose together commands and processes to form pipelines
Latest commit bcfe952 May 10, 2012 Stephen R. Scaffidi minor updates
Failed to load latest commit information.
lib/IPC/Pipeline minor updates May 10, 2012
t some refactoring Mar 23, 2012
.gitignore gitignore is useful to have Mar 20, 2012
README.mkdn made pod weaver work Mar 23, 2012
dist.ini cleanup and prepping for initial release Mar 23, 2012
weaver.ini made pod weaver work Mar 23, 2012



IPC::Pipeline::Composable - compose commands and pipelines


version 0.001



Standard constructor.

  • procs - an arrayref of processes you want in this pipeline.


Get the list of processes that make up this pipeline


When the pipeline is running, get the list of process IDs. Please note - they may not all be running. Checking them is your (or another module's) job.


Run the pipeline with the given inputs and outputs

TODO: describe the arguments

Construct a pipeline from a series of commands, placeholders or other pipelines

Arguments represent processes to run, and each can be any one of the following:

  • arrayref - ['sort', '-k2,2', '-g']
  • subref - sub { print map { join '', @$_ } sort { $a->[1] <=> $b->[1] } map { [split] } <> }
  • Object of type IPC::Pipeline::Composable::Process or IPC::Pipeline::Composable

    my $pl = ipc_pipeline($obj, &some_sub, \@some_array, ...)

Construct a process from a command and a series of arguments or placeholders

Turn a pipeline or process into a process substitution

Construct a placeholder with a name and arguments

TODO: describe arguments

SEE ALSO: the new() method in IPC::Pipeline::Composable::Placeholder

Notes to self:

The desired feature is to have shell-like process-substitution.

The way to do that in the API is to pass a pipeline or command as the argument for a command.

  my $pl = ipc_pipeline(ipc_cmd('gunzip', '-c', ipc_sub('<', 'gzip -c', $0)));
  my $pl = ipc_pipeline(ipc_cmd('gunzip', '-c', ipc_sub('<', ipc_cmd('gzip -c', $0))));

Technically, a command should just be a single-command pipeline.
    my $pl = ipc_cmd('gunzip', '-c', ipc_sub('<', 'gzip -c', $0));

And of course, placeholders...
    my $pl = ipc_cmd('gunzip', '-c', ipc_sub('<', 'gzip -c', ipc_placeholder('file')));
    $pl->run(sink => $sink_fh, file => $0);

To get really silly, perhaps this should work:
    $pl->run(sink_fh => $sink_fh, file => sub{ open my $f, '<', $0; print lc while <$f>; 1 });
    - put a perl process that reads the current script as lowercase in the file placeholder
    - connect the stdout of that perl process to a fifo
    - pass the name of the fifo as an argument to gzip -c
    - connect the stdout of gzip to a fifo
    - pass the name of that fifo as an argument to gunzip -c
    - connect the stdout of gunzip to the sink_fh so it will write to it
    * the result should be the script, in lowercase.

What should really happen:
  - see the ipc_sub when scanning the gunzip command's args
  - create a fifo/named pipe (store the path in a hash assocuated to the ipc_sub)
  - start the gunzip process with its output connected to $sink_fh, passing the fifo as an argument in place of the ipc_sub
  - start the gzip process with its output connected to the fifo for writing

=end notes


Stephen R. Scaffidi


This software is copyright (c) 2012 by Stephen R. Scaffidi.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.




You can find documentation for this module with the perldoc command.

perldoc IPC::Pipeline::Composable


The following websites have more information about this module, and may be of help to you. As always, in addition to those websites please use your favorite search engine to discover more resources.

  • MetaCPAN

A modern, open-source CPAN search engine, useful to view POD in HTML format.

  • Search CPAN

The default CPAN search engine, useful to view POD in HTML format.

  • RT: CPAN's Bug Tracker

The RT ( Request Tracker ) website is the default bug/issue tracking system for CPAN.

  • AnnoCPAN

The AnnoCPAN is a website that allows community annotations of Perl module documentation.

  • CPAN Ratings

The CPAN Ratings is a website that allows community ratings and reviews of Perl modules.

  • CPAN Forum

The CPAN Forum is a web forum for discussing Perl modules.


The CPANTS is a website that analyzes the Kwalitee ( code metrics ) of a distribution.

  • CPAN Testers

The CPAN Testers is a network of smokers who run automated tests on uploaded CPAN distributions.

  • CPAN Testers Matrix

The CPAN Testers Matrix is a website that provides a visual overview of the test results for a distribution on various Perls/platforms.

  • CPAN Testers Dependencies

The CPAN Testers Dependencies is a website that shows a chart of the test results of all dependencies for a distribution.

Bugs / Feature Requests

Please report any bugs or feature requests by email to bug-ipc-pipeline-composable at, or through the web interface at You will be automatically notified of any progress on the request by the system.

Source Code

The code is open to the world, and available for you to hack on. Please feel free to browse it and play with it, or whatever. If you want to contribute patches, please send me a diff or prod me to pull from your repository :)

git clone


Please report any bugs or feature requests to or through the web interface at: