Joe Gottman writes:
>
> Not really. A variable declared with <our> can be accessed from
> anywhere in the program, just by redeclaring it or calling it with the
> "package::" syntax. A variable declared with <my> can be accessed outside
> its scope only if the user returns a reference to it. A static variable
> should be like a <my> variable except that it is only initialized once and
> is not destroyed when it goes out of scope.
>
> Joe Gottman
>
>
it's interesting that "has" have more or less required scope -- its
visible only from object methods and it keeps its value , so maybe
something like this :
sub foo() {
has $s //= 0;
$s ++ ;
}
print foo, foo, foo;
------
arcadi