http://qs321.pair.com?node_id=11114220


in reply to Fastest way to minimally check that file contains perl code?

If it's on Linux, looking for the shebang is probably a very good sign. The line might be missing more often on Windows. Then you can look at use directives (things that look like use stuff before any other line (except the shebang) in the file). strict and warnings are pretty sure signs. Cpan modules give a pretty good clue as well. But even something that looks like a valid use statement like use UnknownModuleBecauseIt'sCustom; put the odds in favor of the file being perl.