Branch: refs/heads/yves/regexp_dynamic_vars_doc_improvement
  Home:   https://github.com/Perl/perl5
  Commit: 43781f0dd44212dca4b0fec539de14657f7f3ab7
      
https://github.com/Perl/perl5/commit/43781f0dd44212dca4b0fec539de14657f7f3ab7
  Author: Yves Orton <[email protected]>
  Date:   2023-02-10 (Fri, 10 Feb 2023)

  Changed paths:
    M pod/perlre.pod
    M pod/perlvar.pod

  Log Message:
  -----------
  perlvar.pod - add "Scoping Rules of Regex Variables" section

This section is used to document the majority of the regex
variables, and previous language referring to them as "dynamically
scoped" has been changed or simplified and a link to the new
section provided to centralize the explanation.

Strictly speaking $1 is globally scoped, but the data it access
is dynamically scoped such that successful matches behave as
though they localize a regex match state variable. (Maybe one
day we will actually have such a variable exposed to the user.)

This patch addss links to the relevant docs in perlsyn and perlvar
to various places where it seemed appropriate, and also cleans up
the wording for most cases to be similar or identical across all
uses. It also cleans up a bit of related language in nearby paragraphs
where it seemed to improve the readability of the docs.

It also replaces the older kind of confusing example code for
understanding the behavior and documents that "goto LABEL" does
not play nicely with the dynamic scoping.

This fixes Github Issue #899.


Reply via email to