IO::Plumbing::Hose - handles that plug into IO::Plumbing pipelines
use IO::Plumbing qw(plumb hose); # catch stderr from that command! my $cat = plumb("cat", output => hose); my $hose = hose; $cat->input($hose); $cat->execute(); $hose->print "Hello, world\n"; $hose->close; # or just grab the FH and wrangle it yourself my $handle = $hose->out_fh; print { $handle } "Hello, world"; close($handle); # and read from it! print $cat->terminus->getline; # "Hello, world\n";
The hose is an interface to IO::Plumbing pipelines that effectively give you a "raw" unidirectional filehandle.
A "gushing" hose is one that has something attached to its input. It gushes data.
A "sucking" hose is one that has something attached to its output. There is a process on the other end which is (hopefully) sucking data.
Copyright 2008, Sam Vilain. All Rights Reserved. This program is free software; you can use it and/or modify it under the same terms as Perl itself.
To install IO::Plumbing, copy and paste the appropriate command in to your terminal.
cpanm
cpanm IO::Plumbing
CPAN shell
perl -MCPAN -e shell install IO::Plumbing
For more information on module installation, please visit the detailed CPAN module installation guide.