Skip to main content

Module version_compat

Module version_compat 

Source
Expand description

Perl version compatibility warnings (PL900) Perl version compatibility lint (PL900)

Warns when code uses features not available in the declared Perl version.

§How it works

  1. First pass over top-level statements: collect declared version (use vN.NN or use N.NNN) and any explicit use feature 'X' calls.
  2. Derive the effective feature set from the declared version (bundle implication — use v5.36 implicitly enables all features available in 5.36).
  3. Second pass (via walker): detect version-gated AST constructs and emit PL900 warnings for those not covered by the effective feature set.

When no version is declared at all, the check emits nothing — undeclared version is ambiguous (the file may be targeting the system Perl).

Functions§

check_version_compat
Check for Perl version compatibility issues.