Yes, your script will not work. Once the main thread starts the child thread for getData(), it will quit, as it has done eveything it supposed to do. That's why add join() fix it.
What's the problem to leave the main thread running? Add join is the right thing to do.
In reply to Re: Working with IO::Socket in thread.
by pg
in thread Working with IO::Socket in thread.
by inductor
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |