|
|
| Pathologically Eclectic Rubbish Lister | |
| PerlMonks |
Re: Threaded Perl: References to subroutines to threadsby renodino (Curate) |
| on Oct 09, 2007 at 15:21 UTC ( #643718=note: print w/ replies, xml ) | Need Help?? |
|
Does anybody now how I can call the subs that I pass to a thread? Short answer: You can't. Long answer: Thread::Queue is really nothing more than a threads::shared array. Which means any ref assigned to it must also be threads::shared. Since you're passing a coderef, it must be threads::shared...except threads::shared cannot be applied to coderefs. See liverpole's response (Re: Threaded Perl: References to subroutines to threads) for an alternative. Perl Contrarian & SQL fanboy
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||