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..."
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to Optionally enable threads in Perl 5.10.0
by ikegami (Patriarch) on Aug 09, 2010 at 18:13 UTC | |
by DrWhy (Chaplain) on Aug 09, 2010 at 18:27 UTC | |
|
Re: How to Optionally enable threads in Perl 5.10.0
by BrowserUk (Patriarch) on Aug 09, 2010 at 18:36 UTC | |
|
Re: How to Optionally enable threads in Perl 5.10.0
by Anonymous Monk on Aug 09, 2010 at 17:53 UTC | |
by DrWhy (Chaplain) on Aug 09, 2010 at 18:18 UTC |