class

Analyzer::Perl::PerlEngine

Inherits FileScanEngine < Analyzer < FileHelper < Reference < Object

Constants

PERL_DELIMITER_CLOSERS = {'('.ord.to_u8 => ')'.ord.to_u8, '['.ord.to_u8 => ']'.ord.to_u8, '{'.ord.to_u8 => '}'.ord.to_u8, '<'.ord.to_u8 => '>'.ord.to_u8}
PERL_MANIFEST_BASENAMES = ["cpanfile", "cpanfile.snapshot", "Makefile.PL", "Build.PL", "dist.ini", "META.json", "META.yml", "META.yaml"] of ::String

Perl dependency manifests. cpanfile and Makefile.PL are the common pair; Build.PL, dist.ini and the generated META.* cover the Module::Build / Dist::Zilla layouts.

PERL_QUOTE_LIKE_PARTS = {"q" => 1, "qq" => 1, "qw" => 1, "qr" => 1, "qx" => 1, "m" => 1, "s" => 2, "tr" => 2, "y" => 2}

Quote-like operators and how many delimited parts follow them.

PERL_SOURCE_EXTENSIONS = [".pl", ".pm", ".psgi", ".t"]

Perl ships in .pl, .pm, .psgi, and .t. Pull those from the extension index instead of walking the whole monorepo file_map. Adapters still re-filter inside analyze_file for framework-specific rules (e.g. skipping .t tests). Paths are detector-registered regular files — no per-path File.exists? / File.directory?.

Class methods

sanitize_lines(lines : Array(String)) : Array(String)
Source
strip_line_comment(line : String) : String

line cut at its # comment. A # is code inside a quoted string, in $#array / $#{...}, and anywhere inside a quote-like operator or regex: s#a#b#, tr###, m#x#, qr#x#, q{#}, /[^#]/ are read through their full delimiter count before comments are looked for.

Source