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

my %vars; ...

Is that closure the only option?

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

Replies are listed 'Best First'.
Re^3: Logic expression evaluation not working. What am I doing wrong?
by GrandFather (Saint) on Jan 05, 2016 at 11:04 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.

    Premature optimization is the root of all job security

      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?