use threads; use threads::shared; package Dweeble; sub new { my $class = shift; my %obj : shared = ( cow => 'bossy' ); return bless \%obj, $class; } sub holycow { print "Holy Cow!\n"; } 1; package main; my $hope : shared = 27; my @ary : shared = (1,2,3,4,5); my $aryref = \@ary; my %hash : shared = ( one => 1, two => 2 ); my $hashref = \%hash; my $cow; my $krelboin = Dweeble->new(); print "hope is ", (threads::shared::_id($hope) ? "shared\n" : "private\n"); print "cow is ", (threads::shared::_id($cow) ? "shared\n" : "private\n"); print "ary is ", (threads::shared::_id($aryref) ? "shared\n" : "private\n"); print "hash is ", (threads::shared::_id($hashref) ? "shared\n" : "private\n"); print "krelboin is ", (threads::shared::_id($krelboin) ? "shared\n" : "private\n");