in reply to Re^3: C++ object & PERL garbage collection
in thread C++ object & PERL garbage collection


yes, your code snippet dumps core
my $dsgn = subA(); $dsgn->method(); sub subA { my $obj = new (c++_object); return $obj; }

however, a "minor" change to the code works
my $obj = new (c++_object) subA($obj) sub subA { my ($object) = @_; $object->method(); }

that's what i mean about up & down in other posts. in other words
CALLEE can NOT return OBJECT CALLER can ALWAYS pass OBJECT
and the C++ folks say that it is PERL deleting the object because it is no longer in scope.