Changes for version 0.003 - 2026-11-03
- An inner anonymous sub with a signature, a prototype or attributes, as sub ($x) { }, sub ($) { } or sub :lvalue { }, now counts as an inner sub, as one without them already did. A sub that changes $_ only in such an inner sub is no longer reported, nor is a call inside one in the block with report_unresolved_calls or report_postfix_for_calls.
- The default rule no longer reports a call, in a list function block, of a sub that changes $_ where $_ is not the caller's element: inside an inner sub, inside the block of a nested list function, inside the body of a foreach with no loop variable, and before a postfix for. A nested block that calls it is reported once, for itself. A call in the body of a for my loop is still reported.
- The list of a foreach with no loop variable, and of a postfix for, is now taken as the caller's, since perl evaluates it before it aliases $_. A sub that changes $_ there is reported, and so is a call there with report_unresolved_calls.
- map EXPR, LIST and grep EXPR, LIST are now judged as a block is, by the default rule: a change to $_ in the expression, or a call there of a sub that changes $_, is reported against that map or grep. Inside an outer block, or in a sub that one calls, it is no longer counted against the outer block, whose list it does not change.
Modules
Do not change $_ in a list function, directly or through a sub that the block calls.