use threads; ... while(1) { async( \&sub1, $hash1 )->detach; async( \&sub2, $hash2 )->detach; sleep(600); }