What are the methods for doing a syntax-check of Perl code, without actually executing any of it?
Proof: proof (reddit disussion, HN discussion)
my $code_to_check = q{ "This is a test... }; eval "sub { $code_to_check }"; warn $@ if $@; # syntax error: unable to find closing double-quotation markThough that largely works, the problem is that the $code_to_check can have BEGIN {...} and use ... in it, which would force code to run during compile time (see "intractible" above).
Opcode and Safe is one possible way to try to limit what BEGIN{} and use can do.