and as far as I can tell this should work.
It doesn't. And it won't whether you understand it or not.
In Perl: DO NOT DEFINE SUBROUTINES WITHIN NESTED SCOPES!
Weird bugs happen whether threads are involved or not. And when threads are involved, they can be even weirder. So don't do it.
I could probably eventually explain why it doesn't work, but then I would have to think about it and probably do some experiments. But as there is no good reason to declare subs in async blocks; and many good reasons not to, I cannot be bothered to work out what does or does not 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".
In the absence of evidence, opinion is indistinguishable from prejudice.
|