Um...._Var is the generic that is called for all
of the 'named' vars...
I have a sub '_access_maker' that defines subs
for each name in the field, those access routines all push on context and call Var.
If you wish to see it, it's fairly old code and probably
could be optimized a bit...but it works...
sub varname ($) { substr $_[0], (1+rindex $_[0],':') }
sub _access_maker { #{{xo{2
my $pkg = shift; #var in $_
{
#TPe "(Dvam: %s::%s() )\xc2\x83",$pkg,$_;
my $proc = '# line ' . __LINE__ . ' "' . __FILE__ . "\"\n" . '
{ use warnings;use strict;
package '.$pkg.';
sub '.$_.' (;$) { # create access routine for packa
+ge::var
$_=[$_,shift, Data::Vars::varname((caller 0)[3]), wantarray]
+;
goto &Data::Vars::_Var};
1}';
eval $proc;
$@ and die "Fatal error in $pkg\::Vars\::_access_maker?: $@\n";
}
} ## end sub _access_maker }}}2
So _access_maker is called at compile time to define 'sub's for each of the the 'field' vars. So the code
during execution is not _access_maker, but the
sub...#create access routine for package::var
You can see why I didn't bother including it...
It's just a push of context and then a goto _Var
|