in reply to Re^2: How to do a "perl -c(w)" check instead of an "eval $string" on a code string
in thread How to do a "perl -c(w)" check instead of an "eval $string" on a code string

If you're interested in success/failure only, you could run system LIST and check the exit code. That would fix the quoting issue of -e:

system $^X, '-wce', $code and warn "syntax check failed\n";