in reply to Re^2: Embedding: load_module(), stack frames and Carp
in thread Embedding: load_module(), stack frames and Carp
I'm not sure I understand. Carp breaks? Or Carp doesn't return what you expect?
Disclaimer: I've never tried anything even remotely like this...
As far as I can tell from your example and other examples found on google, where you've put "/dev/null" is where others normally put the name of the calling file, which would be in keeping with the results returned by caller(). I could make an assumption (which is probably wrong), that my_argv as you've used it, would contain the package, file, line that would be returned by caller (and carp). Package defaulting to 'main' (as it's blank) and line defaulting to zero (as it's blank as well). Since my_argv is passed as a pointer, it may be that you can change the values before each call to call_method() in your C code, like say set the line number to the line number in your C code before making the call. Or it may be that the my_argv values are copied by perl_parse() and you can't change them later. But this is all purely speculation, take it for what it's worth.