http://qs321.pair.com?node_id=755631

sandy1028 has asked for the wisdom of the Perl Monks concerning the following question:

How to create the threads using forks. I should create a 5 threads and all the 5 threads should print numbers in sequence. i.e How can I lock one thread for writing while others for processing the other threads. When one thread is finished completion another thread should write to the log file. Please help me how can I do this.