in reply to (bbfu) (perl -c runs code) Re3: syntax check from within perl
in thread syntax check from within perl
Update: I thought it was discussed here before, but I can't seem to find where. IIRC, the verdict was, basically, that there's just not a way to get arbitrary code syntax checked w/o (at least the possbility of) running some of it.It's worse than that. You can't just skip over the BEGIN blocks in your pretend-parser. You must execute them, because they can affect the later parse, and short of solving the halting problem, you basically can't tell whether they'll do something malicious or not, except perhaps by executing them within a Safe compartment. See my "On Parsing Perl" for specific examples of why you cannot skip executing the BEGIN blocks.
-- Randal L. Schwartz, Perl hacker
|
|---|