in reply to Re^5: PadWalker's closed_over - but for our variables?
in thread PadWalker's closed_over - but for our variables?

because only special vars like $_, $| or $a are really global

Nah, all package variables are globally scoped (visible globally).

The variable you listed simply have a different default namespace if you use them unqualified. That doesn't change their scope.

Seeking work! You can reach me at ikegami@adaelis.com

  • Comment on Re^6: PadWalker's closed_over - but for our variables?

Replies are listed 'Best First'.
Re^7: PadWalker's closed_over - but for our variables?
by LanX (Cardinal) on Apr 05, 2021 at 22:01 UTC
    I attempt to stay as close to perlglossary as possible.

    The term "lexical" is messed up tho.

    edit

    https://perldoc.perl.org/perlglossary#global

    In Perl, only certain special variables are truly global—most variables (and all subroutines) exist only in the current package.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

      The term "lexical" is messed up tho.

      No. Maybe imprecise since there two kinds of lexically-scoped variables, but not messed up.

      I attempt to stay as close to perlglossary as possible.

      Don't do that by by reinventing what global means (or basing yourself on a passage that does that). *That* would be messed up.

      $_ and similar have been called superglobals.

      Seeking work! You can reach me at ikegami@adaelis.com

        > > The term "lexical" is messed up tho.

        > No. Maybe imprecise since there two kinds of lexically-scoped variables, but not messed up.

        perlglossary is explicit that our-vars are not "lexicals".

        https://perldoc.perl.org/perlglossary#lexical-variable

        A variable subject to lexical scoping, declared by my. Often just called a “lexical”. (The our declaration declares a lexically scoped name for a global variable, which is not itself a lexical variable.)

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery

        > Don't do that by by reinventing what global means

        I didn't, I cited perlglossary which was written by Larry.

        > $_ and similar have been called superglobals.

        never heard the term superglobal, any reference?

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery