If you're certain that there will be no code that can execute during the compile (a big assumtion... Have you considered use, modules, etc? How do you ensure it?), then why not just something like this:
$code = 'whatever'; eval qq(return 1; $code); if($@) { chomp($@); print "Syntax error: `$@'\n"; } else { print "Syntax ok\n"; }
bbfu
Black flowers blossom
Fearless on my breath
In reply to Re: eval, but syntax-check only -- like perl -c
by bbfu
in thread eval, but syntax-check only -- like perl -c
by dpuu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |