![]() |
|
We don't bite newbies here... much | |
PerlMonks |
How to Optionally enable threads in Perl 5.10.0by DrWhy (Chaplain) |
on Aug 09, 2010 at 17:48 UTC ( [id://853887]=perlquestion: print w/replies, xml ) | Need Help?? |
DrWhy has asked for the wisdom of the Perl Monks concerning the following question: UPDATE: Based on the responses below and my own experimentation, this is starting to look like a doc bug... ORIGINAL: Hi Monks, I need to be able to only enable threads in an application if it run under perl 5.10.0 or higher. Reading the threads docs for perl 5.10.0, you see this:
It is also important to note that you must enable threads by doing use threads as early as possible in the script itself, and that it is not possible to enable threading inside an eval "" , do, require, or use. That pretty much takes care of all the ways I had thought of to accomplish this. So does anyone here know of way around this so that when run under perl 5.8.8 and below it doesn't try to use threads and with higher versions it is made available? Thanks, --DrWhy "If God had meant for us to think for ourselves he would have given us brains. Oh, wait..."
Back to
Seekers of Perl Wisdom
|
|