You haven't used threads::shared in the current scope (package)
Isn't that accomplished by using use Module::Load::Conditional qw[can_load];?
You always have to pass a reference to threads::shared::share(); unless you disable the prototype
Disable the prototype? I'm not sure what you mean by that. Explicitly using &share($gnWarning) makes no difference, if that's what you mean.
If you know of any way to configure a program to use threads based on the perl executable being compiled with it, and not use it otherwise, other than the method I'm trying, I'd be interested to know.
| [reply] [d/l] [select] |
From the Module::Load::Conditional POD for can_load:
autoload
This controls whether imports the functions of a loaded modules to the caller package. The default is no importing any functions.
You haven't asked for the exported functions to be imported into your package.
Disable the prototype? I'm not sure what you mean by that. Explicitly using &share...
You got it :)
Explicitly using &share($gnWarning) makes no difference,
It won't if share() has not been imported into your package; unless you fully qualify it.
If you know of any way to configure a program to use threads based on the perl executable being compiled with it, and not use it otherwise, other than the method I'm trying, I'd be interested to know.
use Config;
if( $Config{ useithreads } eq 'define' ) {
## compiled with ithreads
require threads; threads->import;
require threads::shared; threads::shared->import
}
else {
## not
}
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.
| [reply] [d/l] [select] |
| [reply] |