Perl open(CMD, "cmd |"); buffering problem..

Hello,

There's a third-party application's command that shows the application's status like "tail -f verybusy.log". When use the command, the output comes every 1-sec. but when it goes in a script below the output comes every 8-sec...What is the problem and how can I fix it?

open(CMD, "/appbin/command |");
while(<CMD>){
        print;
}
close(CMD);

Thanks,

Are you sure the 3rd party application writes everything to STDOUT ? Bcoz, you are likely to miss the stuffs printed on STDERR ... But when you execute manually and see output you are likely to miss where it prints .. So try doing with redirection of error to different place & confirm !

Is that actual unix command used in ""/appbin/command " ? If so, what Operating System and version and what Shell is running the command.