You're starting your thread and then your main thread does nothing else, so it just runs off the end of the script and the whole script terminates.
Try adding sleep 60; after you create the thread. The program will then read and display any input from the socket for 60 seconds before terminating.
Of course, normally your main thread would go about doing whatever else it should be doing, the sleep is just to demonstrate the problem with your code as posted.
In reply to Re: Working with IO::Socket in thread.
by BrowserUk
in thread Working with IO::Socket in thread.
by inductor
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |