...depends on how you interpret the word "pointer" that the OP used.
If you read it as "C pointer" (as I did), i.e. an address of the entry point of the function in the compiled machine code, then the answer is strictly speaking "no", because Perl alone (without the help of XS modules) doesn't provide any direct way to get at the respective address — which in turn means you can't pass it to the C function. (And even if there was a way, it would not be recommended for normal purposes. Also, Perl functions don't directly correspond to compiled machine code.)
If, OTOH, you read "pointer" as "Perl reference", then yes, sure you can pass it to the C function and use call_sv() to call it.
Anyhow, it doesn't really matter whether the answer starts with yes or no, as long as the OP reads the referenced manual, in which case everything will become clear (hopefully :)
| [reply] [d/l] |
Thanks andal and anonymous. Will read perlcall and come back if I have any questions
| [reply] |