![]() |
|
"be consistent" | |
PerlMonks |
Re: Fastest way to minimally check that file contains perl code?by Eily (Monsignor) |
on Mar 13, 2020 at 12:44 UTC ( #11114220=note: print w/replies, xml ) | Need Help?? |
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.
In Section
Seekers of Perl Wisdom
|
|