[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]
Re: Localization method of $1
At 04:14 PM 1/16/00 -0500, Ilya Zakharevich wrote:
>On Sun, Jan 16, 2000 at 12:20:25PM -0800, Peter Scott wrote:
> > But that's not what's happening with $1:
>
>Correct. Saving value of $1 is done via a different mechanism. $1 is
>kinda-tied, and localization is done by kinda-changing-the-FETCH-data:
>
> { package backref1; our $dollar1 = \undef; sub FETCH { $$dollar1 } }
>
>Localization is done by kinda-doing
>
> local $dollar1 = \$$dollar1;
>
>on the entry into a block (only this \$$dollar1 is kinda-precomputed
>at compile time, thus there is no runtime penalty).
>
>The real implementation is not via tie(), but via a different type of
>magic. And access is not via $$dollar1, but via calculations over
>non-SV storage, so it cannot be completely expressed via Perl syntax.
>But I hope you got the feeling...
I get the feeling :-) Thanks.
Is it documented, or is there a list somewhere, of what variables aside
from $1, $2,..., if any, enjoy this kind of behavior?
--
Peter Scott
Pacific Systems Design Technologies
- Follow-Ups from:
-
Ilya Zakharevich <ilya@math.ohio-state.edu>
- References to:
-
Peter Scott <Peter@PSDT.com>
Ilya Zakharevich <ilya@math.ohio-state.edu>
Ilya Zakharevich <ilya@math.ohio-state.edu>
[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]