[Chicago-talk] Sharing data in threads

Stathy G Touloumis stouloumis at tungstenlearning.com
Wed Jun 2 11:34:06 CDT 2004

I thought you asked this before :)

How are you sharing the object?

Use the function call with references :
my $array = [];
&share( $array );
bless $array, $class;


my $array : shared = [];

"If you want to share a newly created reference unfortunately you need to 
use '&share([])' and '&share({})' syntax due to problems with Perl's 

>In playing with threads, the only way I've found to share a complex
>object is to do something like:
>my %data : shared;
>my %hash : shared;
>$data{hash} = \%hash;
>I'd rather do use anonymous hashes like:
>my $data : shared = {};
>But it doesn't (seem) to work.
>How do you construct and share a complex variable?
>Chicago-talk mailing list
>Chicago-talk at mail.pm.org

Stathy G. Touloumis

Application Development Manager, Benchmarks
Edison Schools, Inc.
Ph: 847.676.6663

More information about the Chicago-talk mailing list