in reply to C++ object & PERL garbage collection
A typical strategy is to package your C or C++ thing as a pointer and then make an object out of it. The key here is that perl objects are references so the thing they're pointing to is present as long as the object is. You really ought to post some of your code if you want better help.
<c>package Bar; sub new { my ( $class, $cpp_thing ) = @_; return bless \ $cpp_thing, $class; }</code>⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: C++ object & PERL garbage collection
by Anonymous Monk on Sep 23, 2006 at 01:05 UTC | |
by syphilis (Archbishop) on Sep 23, 2006 at 02:08 UTC | |
by Anonymous Monk on Sep 23, 2006 at 02:28 UTC | |
by diotalevi (Canon) on Sep 23, 2006 at 03:05 UTC |