in reply to Re^2: Logic expression evaluation not working. What am I doing wrong?
in thread Logic expression evaluation not working. What am I doing wrong?

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
  • Comment on Re^3: Logic expression evaluation not working. What am I doing wrong?

Replies are listed 'Best First'.
Re^4: Logic expression evaluation not working. What am I doing wrong?
by Anonymous Monk on Jan 08, 2016 at 23:37 UTC

    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?