my \$info = \$self->{info};
\$info = \$self->{info} = [ Scope::Upper::context_info(\$self->cxt) ]
- unless \$info;
+ unless \$info;
return \$info->[$idx];
}
sub {
{
{
- my $up = Scope::Context->new->up(2); # = Scope::Context->up(2)
+ my $up = Scope::Context->new->up(2); # == Scope::Context->up(2)
# $up points two contextes above this one, which is the sub.
}
}
my $sub_cxt = $cxt->sub($frames);
my $sub_cxt = Scope::Context->sub;
-Returns a new L<Scope::Context> object pointing to the C<$frames>-th subroutine scope above the scope pointed by the invocant.
+Returns a new L<Scope::Context> object pointing to the C<$frames + 1>-th subroutine scope above the scope pointed by the invocant.
This method can also be invoked as a class method, in which case it is equivalent to calling L</sub> on a L<Scope::Context> object for the current context.
}
sub inner {
- my $sub = Scope::Context->new->sub(1); # = Scope::Context->sub(1)
+ my $sub = Scope::Context->new->sub(1); # == Scope::Context->sub(1)
# $sub points to the context for the outer() sub.
}
my $eval_cxt = $cxt->eval($frames);
my $eval_cxt = Scope::Context->eval;
-Returns a new L<Scope::Context> object pointing to the C<$frames>-th C<eval> scope above the scope pointed by the invocant.
+Returns a new L<Scope::Context> object pointing to the C<$frames + 1>-th C<eval> scope above the scope pointed by the invocant.
This method can also be invoked as a class method, in which case it is equivalent to calling L</eval> on a L<Scope::Context> object for the current context.
eval {
sub {
- my $eval = Scope::Context->new->eval; # = Scope::Context->eval
+ my $eval = Scope::Context->new->eval; # == Scope::Context->eval
# $eval points to the eval context.
}->()
}