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 5     5   33185 use strict;
  5         9  
  5         152  
4 5     5   19 use warnings;
  5         22  
  5         319  
5              
6             sub import {
7 6     6   128 my ($class, %authors) = @_;
8              
9 6         12 my $caller = caller;
10             {
11 5     5   21 no strict 'refs';
  5         5  
  5         130  
  6         6  
12 5     5   16 no warnings 'redefine';
  5         5  
  5         672  
13 6 100   16   18 *{"$caller\::authors"} = sub { wantarray ? %authors : \%authors };
  6         30  
  16         595  
14              
15 6         24 (my $category = $caller) =~ s/^Acme::CPANAuthors:://;
16 6     1   16 *{"$caller\::category"} = sub { $category };
  6         115  
  1         260  
17             }
18             }
19              
20             1;
21              
22             __END__