|P is for Practical
Knowing when a code string contains code that will be executed at compile-time/end?by perlancar (Hermit)
|on Aug 15, 2020 at 05:11 UTC
perlancar has asked for the wisdom of the Perl Monks concerning the following question:
I am given a code string by user, and wants to know if the code contains statements or special blocks that are executed not in regular run time. For example:
The reason is because I need to eval the code string and later dump the code back to string. And these statements/blocks do not get included. Demonstration:
I want to be able to warn the user when her code contains these things. I'm thinking of PPI right now, but that seems too heavy. Ideas on other ways to do this?