PIPE and mod_perl2
Denis Spichkin <[email protected]>
| Newsgroups | gmane.comp.apache.mod-perl |
|---|---|
| Message-ID | <CALWxWOOPLLF2Qb9jRdsRBoy1aP-if8cK5_0B9DJ-PMm_JDvj4g@mail.gmail.com> |
Hello.
Trying to write a program for mod_perl2 that gradually display its
output such as output from "ping" (output during PIPE execution).
For example
http://www.websitepulse.com/help/testreq.php?host=www.ya.ru&location=9&type=1&singletestpage=ping-test&pass=&ttref=http%3A%2F%2Fwww.websitepulse.com%2F&__=1323068838832
At the moment I was able display all output at once. That completely
unacceptable for this type of program
my $ping = '/bin/ping';
my $count = '-c 10';
open (PIPE, "$ping $count $param |");
if (!<PIPE>) {
$r->print("Error: can't open the pipe $!");
return OK;
};
while (<PIPE>) {
$r->write($_); # tried $r->print and $r->puts......with
the same result
$r->write('<br />');
};
close (PIPE);
Please if anyone know how possible gradually display output in
mod_perl2 help me........