File Coverage

lib/Acme/CPANAuthors/Register.pm
Criterion Covered Total %
statement 22 22 100.0
branch 2 2 100.0
condition n/a
subroutine 7 7 100.0
pod n/a
total 31 31 100.0


line stmt bran cond sub pod time code
1             package Acme::CPANAuthors::Register;
2              
3 6     6   271255 use strict;
  6         12  
  6         236  
4 6     6   35 use warnings;
  6         28  
  6         625  
5              
6             sub import {
7 8     8   375 my ($class, %authors) = @_;
8              
9 8         24 my $caller = caller;
10             {
11 6     6   72 no strict 'refs';
  6         14  
  6         331  
  8         11  
12 6     6   32 no warnings 'redefine';
  6         12  
  6         1231  
13 8 100   22   34 *{"$caller\::authors"} = sub { wantarray ? %authors : \%authors };
  8         45  
  22         243252  
14              
15 8         34 (my $category = $caller) =~ s/^Acme::CPANAuthors:://;
16 8     1   21 *{"$caller\::category"} = sub { $category };
  8         264  
  1         957  
17             }
18             }
19              
20             1;
21              
22             __END__