http://www.perlmonks.org?node_id=853016


in reply to Re^4: how to check syntax of code inside a scalar?
in thread how to check syntax of code inside a scalar?

What if you always inject a
BEGIN {exit}
will it still do the compile step?
the hardest line to type correctly is: stty erase ^H

Replies are listed 'Best First'.
Re^6: how to check syntax of code inside a scalar?
by snoopy (Curate) on Aug 05, 2010 at 05:05 UTC
    I't wouldn't do the compile step, but because this happens early, it would pretty well bypass any syntax checking whatsoever:
    perl -c -e 'BEGIN{exit}; BEGIN{print "yay\n"};@&$^^#@!.' -e syntax OK