In my moosified TheObject package, I try to do this:
around 'new' => sub {
my $orig=shift;
my $class=shift;
my $self=$class->$orig(@_);
my $shared_self : shared = shared_clone($self);
return $shared_self;
};
Then, in the code with threads:
my $obj :shared =new TheObject();
But then I get ‘Unsupported ref type: CODE’ at this line:
my $shared_self : shared = shared_clone($self);
I am running 5.8.8.
perl -Mthreads -le'print $threads::VERSION'
1.74
Anyone have an idea what is going on here?
I think I figured this out. My object does in fact contain coderefs within and now that I think about it – how would I even deep copy a coderef in perl?