in reply to Re^3: Scope surprise
in thread Scope surprise

Anyway, the basic idea here was that the OP could get exactly the result he was hoping for with almost the exact code he originally used, and understands so well.

and that change would be to use
my $foo = 1; foo(); -my $foo = 2; +$foo = 2;

Not adding our and changing my to local.

Not a parameter. A setting. For example, suppose you temporarily want to change the settings for a module like Data::Dumper

Since it worked with lexicals, I somehow doubt we're talking about config variables in another modules. Either he needs a global var (where there should only be one decleration) or a parameter (likely because it's a common beginner mistake to avoid parameters). The likeliness of it being a parameter is reinforced by the set-and-call pattern.