As everybdy has said, your problem is not threading.
An easy solution is to just sleep your program for as long as it takes for the file to be created.
just something like
sleep(3); while the file is being created where 3 is however long it takes will fix the problem, although its not great coding its an easy simple solution.
Comment on Re: Runing "regular" code with threaded perl
Sleep is a bad hack that fails the moment the system runs what the program is waiting on slower. Please don't encourage sleep. The proper way to do it is to test for some condition.