in reply to Fastest way to minimally check that file contains perl code?
80% should be easy enough to achieve, use some rough regex to strip all variables with sigils and function calls and comments and count the built in commands...
A quick search didn't show any cpan modules for that (which is most likely due to my search strategy)
I know about JS libraries for syntax highlighting guessing the code.
The recommended technique is to train a classifier based on a "term frequency algo" (see tf-idf) with right and wrong code,( problem here is I don't know your wrong code, PHP should pose the biggest problem)
We also had a similar discussion in the past in order to decide if a poster forgot code tags.
After finding it again, I realized that it's so detailed that it merits an extra reply.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
|---|