in reply to Re^5: Unusual variable declaration
in thread Unusual variable declaration

The point is that you said

> > I would not call that "declaring a variable".

Please define "declaration" in an language agnostic way which makes my more "declarative" than our.

See also https://en.m.wikipedia.org/wiki/Declaration_(computer_programming)

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Replies are listed 'Best First'.
Re^7: Unusual variable declaration
by Jenda (Abbot) on Nov 05, 2019 at 16:33 UTC
    package Foo; $Foo::y = 42; sub foo { my $x; our $y; ... } sub bar { my $x; our $y; ... }

    Each of the two my $x declares a new variable. Both the our $y instruct the compiler to allow you to temporarily use a short name for the same global variable. They do NOT declare a variable!

    Jenda
    1984 was supposed to be a warning,
    not a manual!

      > > Please define "declaration"

      > They do NOT declare a variable!

      Not a definition.

      You are effectively saying reiterating again and again that my and our have differences and are using my as your personal standard for declaration.

      I'm tired of this.

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery FootballPerl is like chess, only without the dice