blib/lib/B/CompilerPhase/Hook.pm

filter: Statementstmt 83.3% 25 / 30 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 84.2% 32 / 38 CC 3 SCAR 7.8
CC
3
Cov
81%
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.03';
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 $AUTHORITY = 'cpan:STEVAN';
14 1 XSLoader::load( __PACKAGE__, $VERSION );
15  
16 # now set up the DWIM methods ...
17 1 *enqueue_BEGIN = \&append_BEGIN;
18 1 *enqueue_CHECK = \&prepend_CHECK;
19 1 *enqueue_INIT = \&append_INIT;
20 1 *enqueue_UNITCHECK = \&prepend_UNITCHECK;
21 1 *enqueue_END = \&prepend_END;
22 }
23  
24 sub import {
25 1 ▶ shift;
Subroutine import: called CC=3 SCAR=14.2
26 1 ▶ if ( @_ ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 1 1
27 0 my $to = caller;
28 0 my $from = __PACKAGE__;
29 0 foreach ( @_ ) {
30 1 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
31 0 *{ $to . '::' . $_ } = $from->can( $_ );
32 }
33 }
34 }
35  
36 1 1;
37  
38 __END__
↑ Summary Hook.xs »