The solution is to call threads::join on each thread handle before exiting the main thread. This will ensure that all threads have finished before your main thread terminates.
You have this line in your code
#$_->join for @thre;
Why have you commented it out?
In reply to Re: Nasty MultiThread problem
by BrowserUk
in thread Nasty MultiThread problem
by JFarr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |