in reply to Re^3: 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.

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?

  • Comment on Re^4: Logic expression evaluation not working. What am I doing wrong?
  • Download Code