in reply to Re: foreach $1
in thread foreach $1

if $a is a special var then @a and %a will act special too, even without carrying a meaning.

Well, they are considered "declared", but that's the extent of it.

Replies are listed 'Best First'.
Re^3: foreach $1
by LanX (Saint) on Jun 08, 2020 at 23:55 UTC
    > I.e. if $a is a special var then @a and %a will act special too, even without carrying a meaning.

    > > Well, they are considered "declared", but that's the extent of it.

    Nope, e.g. $% is a special var which is global, @% isn't documented anywhere, but still global

    DB<1> x @%=1..3 0 1 1 2 2 3 DB<2> x {package A; @%} 0 1 1 2 2 3 DB<3> x @a=1..3 # not global 0 1 1 2 2 3 DB<4> x {package A; @a} empty array DB<5>

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