You could try to actually run perl -c on your code: my @results = map { system "echo '$_' | perl -c " } @code;. You have to escape your strings correctly though.
Or an eval may do the trick as well: my @results = map { eval "sub { $_ }"; $@ } @code; where adding a sub block prevents the code from actually being run.
In both those exemple you might still have code that is run, in a BEGIN block for example.
In reply to Re: "perl -c" an array of code in a running program
by Eily
in thread "perl -c" an array of code in a running program
by stevieb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |