Language dialect:
--perl
as a catch-all--perl5
and--perl6
for files that can positively identified as one or the other
Criteria for the latter:
- file extension:
.p5
,.pl5
,.pm5
vs.p6
,.pl6
,.pm6
- shebang
use v*
in first (non-shebang or non-comment?) line for files with generic extension
Edge cases:
- no shebang or
use
at start of file - shebang disagrees with
use
- freely intermixed p5/p6 blocks with lexical
use
(not possible right now, but one can dream...)
Pragmatic resolution strategy:
- only detect as
--perl
- detect as both
--perl5
and--perl6
- only detect as
--perl
Alternative resolution strategy:
- look for heuristics that discern p5 and p6 code
Personal preference is the pragmatic solution, as the latter is brittle and slow