> I've come up with some *simple* code that seems to work:
> 
> #!/usr/bin/perl
> 
> use strict;
> use warnings;
> 
> $| = 1;
> my $total = `make -n | wc -l`;
> my ($count, $line);
> open MAKE, "make |";
> foreach $line (<MAKE>) {
>    $count++;
>    my $percent = int(($count / $total) * 100);
>    print "..$percent";
> }

You may find that the 'MAKE' file handle is buffered by the make
application.

I order to ensure 'make' doesn't buffer its output, you need to run it
in its
own pseudo-terminal.   The Expect module may be able to help, since it
runs
apps in pseudo-terminals, or someone else may offer a better solution.

David


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to