while( my $file = <*.properties> ) { ## Check the glob matches your files! my $thr = threads->create(\&sendRequest, $file, 'localhost', $peerPort ); }