for my $code ('$x+$y', '$x+') { printf "code=[%-5s] syntax=%s\n", $code, eval('return 1; ' . $code) ? "ok" : "bad: $@"; }
But you need to consider the effects of things like BEGIN blocks.
Dave.
In reply to Re: How to do perl -c inside perl?
by dave_the_m
in thread How to do perl -c inside perl?
by rockyb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |