No, the C program is working correctly. If I run it from the command line without calling it from PERL, it see the percent completed being printed to the screen as the C program progressed.
+::010
(some times later)
+::020
+::030
+::040
+::050
+::060
+::070
+::080
+::090
+::100
However, when I run the Perl script and invoking the C program from withing PERL, all the above lines get printed out at the same time after the C program are done. I can monitor this because I have another terminal connected to the database where the C program are sending requests and only when the C program have finished all its requests and disconnected after a few hours do I see all the above lines get printed to the screen all at once.