use strict; use warnings; use threads; use threads::shared; our @STARRING_CLASSES=qw(Carp.pm List/Util.pm Test/More.pm); my @aBig; my $aBig=bless(\@aBig,"MaybeSharable"); my $aBigShared=&share($aBig); my $t; require Carp; $t = threads->new(sub { require List::Util; print "-------------------------------------\n" , "tid=".threads->tid . " \\\%INC=".\%INC . " \\\@INC=".\@INC."\n"; while(my($k,$v)=each(%INC)) { $k="**$k" if grep{$k eq $_} @STARRING_CLASSES; print "$k=$v\n" }; print "\n"; }); $t->join(); $t = threads->new(sub { require Test::More; print "-------------------------------------\n" , "tid=".threads->tid . " \\\%INC=".\%INC . " \\\@INC=".\@INC."\n"; while(my($k,$v)=each(%INC)) { $k="**$k" if grep{$k eq $_} @STARRING_CLASSES; print "$k=$v\n" }; print "\n"; }); $t->join();