I'd like to second BrowserUK's advice, esp re use strict, warnings.
Also, replace your system() calls with the built-in Perl equivalents, which will give you better error handling and remove the process-creation overhead you're getting.
As well, check for errors in opendir() :
http://perldoc.perl.org/perlopentut.html.
BTW, forking != threading.