OUTPUT:
RETVAL
-SV *
-DOWN(...)
-PROTOTYPE: ;$
-PREINIT:
- I32 cxix;
-CODE:
- SU_GET_CONTEXT(0, 0);
- if (++cxix > cxstack_ix)
- cxix = cxstack_ix;
- RETVAL = newSViv(cxix);
-OUTPUT:
- RETVAL
-
void
SUB(...)
PROTOTYPE: ;$
The level of the scope just above C<$from>.
-=head2 C<DOWN $from>
-
-The level of the scope just below C<$from>.
-
=head2 C<SUB $from>
The level of the closest subroutine context above C<$from>.
The functions L</reap>, L</localize>, L</localize_elem>, L</localize_delete>, L</unwind> and L</want_at> are only exported on request, either individually or by the tags C<':funcs'> and C<':all'>.
-Same goes for the words L</TOP>, L</HERE>, L</UP>, L</DOWN>, L</SUB>, L</EVAL> and L</CALLER> that are only exported on request, individually or by the tags C<':words'> and C<':all'>.
+Same goes for the words L</TOP>, L</HERE>, L</UP>, L</SUB>, L</EVAL> and L</CALLER> that are only exported on request, individually or by the tags C<':words'> and C<':all'>.
=cut
our @EXPORT = ();
our %EXPORT_TAGS = (
funcs => [ qw/reap localize localize_elem localize_delete unwind want_at/ ],
- words => [ qw/TOP HERE UP DOWN SUB EVAL CALLER/ ],
+ words => [ qw/TOP HERE UP SUB EVAL CALLER/ ],
);
our @EXPORT_OK = map { @$_ } values %EXPORT_TAGS;
$EXPORT_TAGS{'all'} = [ @EXPORT_OK ];
use strict;
use warnings;
-use Test::More tests => 13;
+use Test::More tests => 12;
require Scope::Upper;
-for (qw/reap localize localize_elem localize_delete unwind want_at TOP HERE UP DOWN SUB EVAL CALLER/) {
+for (qw/reap localize localize_elem localize_delete unwind want_at TOP HERE UP SUB EVAL CALLER/) {
eval { Scope::Upper->import($_) };
is($@, '', 'import ' . $_);
}
use strict;
use warnings;
-use Test::More tests => 46;
+use Test::More tests => 42;
use Scope::Upper qw/:words/;
is HERE, 0, 'main : here';
is TOP, 0, 'main : top';
is UP, 0, 'main : up';
-is DOWN, 0, 'main : down';
is SUB, undef, 'main : sub';
is EVAL, undef, 'main : eval';
is HERE, 1, '{ 1 } : here';
is TOP, 0, '{ 1 } : top';
is UP, 0, '{ 1 } : up';
- is DOWN, 1, '{ 1 } : down';
- is DOWN(UP), 1, '{ 1 } : up then down';
- is UP(DOWN), 0, '{ 1 } : down then up';
}
do {