blib/lib/B/CompilerPhase/Hook.pm

filter: Statementstmt 80.0% 20 / 25 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 81.8% 27 / 33 CC 3 SCAR 7.8
CC
3
Cov
78%
import
4.1
BEGIN
1.0
BEGIN
1.0
CRAP 2.2
↑ Summary Hook.xs »
1 package B::CompilerPhase::Hook;
2 # ABSTRACT: Programatically install BEGIN/CHECK/INIT/UNITCHECK/END blocks
3  
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 our $VERSION;
8 1 our $AUTHORITY;
9  
10 1 ▶use XSLoader;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 BEGIN {
12 1 ▶ $VERSION = '0.02';
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 $AUTHORITY = 'cpan:STEVAN';
14 1 XSLoader::load( __PACKAGE__, $VERSION );
15 }
16  
17 sub import {
18 1 ▶ shift;
Subroutine import: called CC=3 SCAR=14.2
19 1 ▶ if ( @_ ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 1 1
20 0 my $to = caller;
21 0 my $from = __PACKAGE__;
22 0 foreach ( @_ ) {
23 1 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
24 0 *{ $to . '::' . $_ } = $from->can( $_ );
25 }
26 }
27 }
28  
29 1 1;
30  
31 __END__
↑ Summary Hook.xs »