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   63864 use 5.008;
  3         12  
  3         99  
4 3     3   14 use strict;
  3         5  
  3         88  
5 3     3   14 use warnings;
  3         9  
  3         139  
6              
7             BEGIN {
8 3     3   6 $return::thence::AUTHORITY = 'cpan:TOBYINK';
9 3         65 $return::thence::VERSION = '0.003';
10             }
11              
12 3     3   2765 use Scope::Upper qw( unwind CALLER );
  3         3251  
  3         537  
13              
14             sub return::thence
15             {
16 4     4 0 1207 my @caller = caller(my $i = 0);
17 4         29 my $ctx = CALLER(0);
18 4         36 while (my @level = caller(++$i)) {
19 9 100       40 next if $level[1] ne $caller[1]; # filename
20 6 50 66     118 last if $level[3] =~ /^$caller[0]\::(\w+)$/ && $1 ne '__ANON__' && ($ctx = CALLER $i);
      66        
21             }
22 4         63 unwind @_ => $ctx;
23             }
24              
25             1
26             __END__