Hi all,

In some case, a class will have a static object for special purpose. For 
instance:
static foo foo::bar
I want to port this object to perl by wrapping it as a sub like this:
foo * 
foo::bar()
CODE:
RETVAL = &(foo::bar);
OUTPUT:
RETVAL

This will always cause a segfault while invoking the sub in perl script.
Does anyone know the reason?

Another question, is there any better way to port a class method which 
returns 
an object. Like this:
foo foo::bar2()
since the returned object is local, which is usually allocated on stack, I 
have to 
new an object on heap and copy the content from the local one in my perlxs 
code. Is there a better way to handle this case?

Great thanks.
-- 
Bst Rgrs, Dongxu

Reply via email to