blib/lib/B/CompilerPhase/Hook.pm

filter: Statementstmt 100% 30 / 30 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 100% 38 / 38 CC 3 SCAR 5.6
CC
3
Cov
100%
import
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.8
↑ Summary Hook.xs »
1 package B::CompilerPhase::Hook;
2 # ABSTRACT: Programatically install BEGIN/CHECK/INIT/UNITCHECK/END blocks
3  
4 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 5 our $VERSION;
8 5 our $AUTHORITY;
9  
10 5 ▶use XSLoader;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 5 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
12 5 $VERSION = '0.04';
13 5 $AUTHORITY = 'cpan:STEVAN';
14 5 XSLoader::load( __PACKAGE__, $VERSION );
15  
16 # now set up the DWIM methods ...
17 5 *enqueue_BEGIN = \&append_BEGIN;
18 5 *enqueue_CHECK = \&prepend_CHECK;
19 5 *enqueue_INIT = \&append_INIT;
20 5 *enqueue_UNITCHECK = \&prepend_UNITCHECK;
21 5 *enqueue_END = \&prepend_END;
22 }
23  
24 6 ▶sub import {
Subroutine import: called CC=3 SCAR=11.0
25 6 shift;
26 6 ▶ if ( @_ ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 4 2 6
27 4 my $to = caller;
28 4 my $from = __PACKAGE__;
29 4 foreach ( @_ ) {
30 5 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
31 10 *{ $to . '::' . $_ } = $from->can( $_ );
32 }
33 }
34 }
35  
36 5 1;
37  
38 __END__
↑ Summary Hook.xs »