vi_srikanth
asked on
Threads - Shared - Reference
Hi Friends, I have the following code:
use threads;
use threads::shared;
my $a='abc';
my $b : shared = \$a;
For this, I'm getting the error: Invalid value for shared scalar at del.pl line 4.
Basically, I would like to have a variable(here $b) which is shared and holds a reference. Is this possible? If so please help me.
Thanx
use threads;
use threads::shared;
my $a='abc';
my $b : shared = \$a;
For this, I'm getting the error: Invalid value for shared scalar at del.pl line 4.
Basically, I would like to have a variable(here $b) which is shared and holds a reference. Is this possible? If so please help me.
Thanx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
use threads;
use threads::shared;
my $bar : shared;
my $foo : shared;
$foo = \$bar;