I think a problem with the syntax check idea is, what exactly would you feed to perl -c ?
If you do it line by line, and have a code snippet like this
for my $foo (@foo) { for my $bar (@$foo) { push @{ $self->{results} }, { baz => foo( $bar->{baz}, $bar->{quux}[1] ) }; } }
not a single line (on its own) would pass a syntax check, while taken as a whole, the snippet is perfectly valid Perl code.
Of course, you could try to work around that problem by passing multiline snippets to the syntax checks, but then the number of possible combinations is going to explode rather soon, even for moderate file sizes... So you'd at least need some additional heuristic to identify likely beginnings of code sections, or some such, in order to make this approach feasible in practice.
In reply to Re^2: Recognizing Perl in text
by Anonyrnous Monk
in thread Recognizing Perl in text
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |