in reply to Declaring/Assigning thread shared vars
share was imported into the current package (main?), but it was never imported into the cfg package, so shared is not available there unless you give the fully qualified name.
Solution 1
use strict; use threads; use threads::shared; { package cfg; use threads; use threads::shared; %cfg::thash : shared = (); }
Solution 2
use strict; use threads; use threads::shared; # Don't need no "package cfg", since we're # specifying cfg:: in the variable name. %cfg::thash : shared = ();
I don't know about your other problem. I'm not familiar with multithreading in Perl.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Declaring/Assigning thread shared vars
by Anonymous Monk on Nov 18, 2004 at 02:03 UTC |