Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: How to Optionally enable threads in Perl 5.10.0

by DrWhy (Chaplain)
on Aug 09, 2010 at 18:18 UTC ( [id://853893]=note: print w/replies, xml ) Need Help??


in reply to Re: How to Optionally enable threads in Perl 5.10.0
in thread How to Optionally enable threads in Perl 5.10.0

That's interesting, but if it's unsafe to 'require threads' directly, seems that this approach is just doing the same thing indirectly and would suffer the same kind of problem. If the problem is just that you must be sure that threads is there at compile time maybe something like this would work:
BEGIN { if ($] > 5.008008) { require threads; } }

--DrWhy

"If God had meant for us to think for ourselves he would have given us brains. Oh, wait..."

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://853893]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2025-03-16 13:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When you first encountered Perl, which feature amazed you the most?










    Results (54 votes). Check out past polls.