It's a package variable, not a closure. In a sense it's a global variable, but notionally private to the package. There are other ways it could be done, but for a "simple" example it is expedient and not totally terrible.
Premature optimization is the root of all job security
| [reply] |
It's a package variable, not a closure. In a sense it's a global variable, but notionally private to the package. There are other ways it could be done, but for a "simple" example it is expedient and not totally terrible. actually it is a closure :) it may not look like it but it is, just like this is a closure, foo()/bar() close over $foo { my $foo; sub foo { $foo++; } sub bar { $foo--;} }
No, its not totally terrible, but I wanted to know these other ways because a global is inherently limited
Does Marpa provide a stash DoStuff can access?
| [reply] [d/l] |