Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

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??

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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11114220]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2020-05-28 22:25 GMT
Find Nodes?
    Voting Booth?
    If programming languages were movie genres, Perl would be:

    Results (166 votes). Check out past polls.