embedded perl in c - is there a flag for a "runitme error" for scripts executed by perl_run()?

Karl Source

If a "runtime error" happens in a script that is executed by perl_run() in an embedded perl instance on C (actually C++11), is there a more reasonable way other than to look for "Runtime error in..." at the stderr stream?

I'm using perl 5.26.1.




answered 6 months ago ikegami #1

You can catch exceptions thrown by code executed by call_*, so use the approach described in Calling a Perl subroutine from your C program, and refer to G_EVAL in perlcall. Use do from within the called code to get Perl to execute a file.

comments powered by Disqus