Question about pipe in Perl

Posted by Uri on Stack Overflow See other posts from Stack Overflow or by Uri
Published on 2010-05-23T20:44:32Z Indexed on 2010/05/23 20:50 UTC
Read the original article Hit count: 217

Filed under:

The following code is working sort of fine:

open( PIPE, '-|', 'ant' );
for( <PIPE> ) {
    print;
}

However, it doesn't do what I want. Since the Ant build can take 5 minutes, I would like to see the output line by line. Instead, I'm getting the entire input at the end of the process.

Looking at it with the Perl debugger, Perl waits at the 'for' statement, until Ant terminates. Why is that?

© Stack Overflow or respective owner

Related posts about perl