summaryrefslogtreecommitdiff
path: root/devel/p5-IO-MultiPipe/pkg-descr
blob: b43a64ee14dd35b0ee0e777f6b7bebc091868ec2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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 separately.

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');