You will need a multi-threading version of perl (hint: type 'perl -v' and look for 'thread-multi' in the output). After that, follow Bianca's advice (i.e., rtfm). We'd be happy to look at your attempt to solve this problem.