Changes for version 0.04 - 2026-06-14

  • New patterns:
    • `case FOO` - a bareword naming an inlinable `use constant` folds to its value at compile time and is classified like the literal it holds (numeric -> ==, string -> eq; dispatch-eligible). Zero runtime cost. Package-qualified constants (`Pkg::FOO`) are supported.
    • `case == $x` / `case eq $x` - compare the topic against a runtime scalar variable, naming the operator as in Perl itself: `==` is numeric (looks_like_number-guarded on both sides), `eq` is string. The operand is a plain scalar ($name or $Pkg::name), including `our` and package globals. Both are undef/type-safe and warning-free.
    • `case =~ $rx` - match the topic against a runtime pattern (a qr// or a string) held in a scalar, complementing the compile-time /literal/ form. Undef-safe and warning-free. As a runtime membership test it does not set capture variables ($1, @+); for captures use a predicate arm, `case sub { $_[0] =~ $rx }`.

Modules

compile-time, lexically-scoped switch/case