Feb 12, 2012, 11:57 AM
Post #4 of 4
Since a blessed object ref is returned, you need to use the shared_clone.
Re: [samir.gambler] Sharing object in perl
[In reply to]
I don't have Windows to test, but did a sample below.
from docs: Shared variables can only store scalars, refs of shared variables, or refs of shared data.
$ro_api = Win32::OLE->new("xxx.xxx");
has 'name' => ( is => 'rw', isa => 'Str');
my $testobj = Test->new(name=>'test name');
my $var :shared = shared_clone($testobj);
print "Test: ",$testobj->name()."\n";
print "Var: ",$var->name(),"\n";
Test: test name
Var: test name