One solution is to have the only actual embedded Perl code be a function to load more Perl code. Then syntax errors or missing modules in the additional Perl code are turned into dies that you already know how to trap. | [reply] |
What about running your embedded perl code through "perl -c" first and looking for "syntax OK"?
I'm having difficulty seeing how perl code with syntax errors and missing modules would end up in an embedded application when it could be checked in advance. Are you letting users enter arbitrary perl from an input stream? If so, that's a security risk. | [reply] |
Understood. However, the program itself is a large server and the Perl code consists of add-on modules written by users for themselves to add functionality. While ideally each user would run their code through 'perl -c' ahead of time, I don't want to punish them for a bug in their Perl code with a crash of the entire server that may be supporting other requests.
| [reply] |