Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^2: Recognizing Perl in textby Anonyrnous Monk (Hermit) |
on Jan 06, 2011 at 13:47 UTC ( [id://880823]=note: print w/replies, xml ) | Need Help?? |
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
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 Section
Seekers of Perl Wisdom
|
|