If you start a thread (->create()) and then immediately wait for it to finish (->join), that is the same as not starting a thread at all.
If you are not interested in the result of the thread, you should detach it.
The simplest way of doing what I think you are trying to achieve with your snippet above is:
async( \&status_line )->detach;
Notice there are no parens () after the name of the sub to be run asynchronously.
What you have above should have produced several error messages, because you are calling the sub status_line() then attempting to take a reference to its return value, and then pass that as the code reference to the thread, which obviously won't work.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
|