freebsd-ports/devel/p5-IO-MultiPipe/pkg-descr
Philip M. Gollucci 3d3cc97306 - Fix INDEX
- relocate net/p5-IO-MultiPipe -> devel/p5-IO-MultiPipe

Pointhat:       me :(
2009-01-26 22:48:20 +00:00

20 lines
590 B
Text

Normally if a part of a pipe fails, depending on the location, it won't
be detected. This breaks down a command involving pipes and runs each
command seperately.
It uses open3 to run each chunk of the pipe.
use IO::MultiPipe;
my $pipes = IO::MultiPipe->new();
#This sets the pipe that will be run.
$pipes->set('sed s/-// | sed s/123/abc/ | sed s/ABC/abc/');
if ($pipes->{error}){
print "Error!\n";
}
#'123-ABCxyz' through the command set above.
my $returned=$pipes->run('123-ABCxyz');
WWW: http://search.cpan.org/~vvelox/IO-MultiPipe/