The Open Source Swiss Army Knife

/code/perl/unix_perl/
/code/perl/unix_perl/ + sub-categories
http://www.sirfsup.com/
web directory content
    
      

Not logged in
Chat Register Login
return to:  http:/www.sirfsup.com      /code   /perl   /unix_perl 
Permalink: threads1.perl
Title: not able to store a ref in a shared var
article options : please login   |  raw source view  

#!/usr/bin/perl

use threads;
use threads::shared;
my $a= "abc";
my $b = &share(\$a);
print $a . "\n";
print $$b . "\n";
$a.="def";
print $a . "\n";
print $$b . "\n";

my $bar : shared;
my $foo : shared;
$foo = \$bar;


Leave a Reply
Your Name:     anonymous
Your Email:
Website:  
Comments:

The author will be notified of your reply.
return to top