A possible solution to a problem you have implied but not stated is this: Have your C program create an empty "signal file" somewhere while it's writing to the output file. Then have your Perl code check for the existance of this file (
-e $file) on startup. The Perl code can then take action based on whether this signal file exists or not - exit, wait for a bit and try again, proceed anyway, etc. Once the C program is done with its write, it should remove the signal file.
---
It's all fine and dandy until someone has to look at the code.