Bad idea... try it with this:
syntax_ok(qq{BEGIN { print "yay\n"; }});
and you'll see that the BEGIN block still gets run, bypassing your return statement. So I'd consider it rather unsafe.
In reply to Re^3: how to check syntax of code inside a scalar?
by Crackers2
in thread how to check syntax of code inside a scalar?
by tjking
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |