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

In reply to Re^6: how to check syntax of code inside a scalar? by snoopy
in thread how to check syntax of code inside a scalar? by tjking

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":