Closed unhandyandy closed 9 years ago
Or maybe by
&{$thing->{action}}(3)
@unhandyandy This is not currently possible; IIRC, Inline::Lua
marshals objects (including tables) between the Perl and Lua environments, so tables lose their metatable. You can, however, do the $object->{method_name}->(@args)
trick, as long as method_name
is a key of $object
itself and not accessed via a metatable.
OK, thanks.
Can I define an object with a method in Inline Lua and then call it in Perl?
For example, should I be able to have
and then call it in perl by thing->action( 3 )?