in reply to Re^3: localizing lexical without messing with tie ?
in thread localizing lexical without messing with tie ?

>Please clarify.

see Re^2: localizing lexical without messing with tie ?.

As I said, an additional local untie does what I wanted.

Anyway this is far to complicated for an edge case, the best solution for me is to forbid the use of tied variables.

Cheers Rolf

  • Comment on Re^4: localizing lexical without messing with tie ?

Replies are listed 'Best First'.
Re^5: localizing lexical without messing with tie ?
by ikegami (Patriarch) on Sep 09, 2010 at 03:03 UTC

    see Re^2: localizing lexical without messing with tie ?.

    What do you call "passed variable"?

    As I said, an additional local untie does what I wanted.

    Doubtful. The untie isn't local. I've provided a solution that works where you used untie.

      > What do you call "passed variable"?

      sub tst (&$) { $_[1]++; # passed variable $_[0]->(); # passed block } tst { print $c} $c;

      Cheers Rolf

        So "override a global lexical variable for a dynamic scope", where you have access to the global via an alias.

        Could you use $_, $a and $b or arguments instead?

        I don't see how PadWalker would help. If you found a solution using it, it might be possible to recreate the solution using B (a core module).