File Coverage

blib/lib/return/thence.pm
Criterion Covered Total %
statement 20 20 100.0
branch 3 4 75.0
condition 4 6 66.6
subroutine 6 6 100.0
pod 0 1 0.0
total 33 37 89.1


line stmt bran cond sub pod time code
1             package return::thence;
2              
3 3     3   132952 use 5.008;
  3         12  
  3         125  
4 3     3   17 use strict;
  3         6  
  3         262  
5 3     3   19 use warnings;
  3         25  
  3         164  
6              
7             BEGIN {
8 3     3   7 $return::thence::AUTHORITY = 'cpan:TOBYINK';
9 3         105 $return::thence::VERSION = '0.002';
10             }
11              
12 3     3   7187 use Scope::Upper qw( unwind CALLER );
  3         4424  
  3         800  
13              
14             sub return::thence
15             {
16 4     4 0 1292 my @caller = caller(my $i = 0);
17 4         31 my $ctx = CALLER(0);
18 4         36 while (my @level = caller(++$i)) {
19 9 100       42 next if $level[1] ne $caller[1]; # filename
20 6 50 66     134 last if $level[3] =~ /^$caller[0]\::(\w+)$/ && $1 ne '__ANON__' && ($ctx = CALLER $i);
      66        
21             }
22 4         58 unwind @_ => $ctx;
23             }
24              
25             1
26             __END__