File Coverage

blib/lib/common/header.pm
Criterion Covered Total %
statement 39 39 100.0
branch n/a
condition n/a
subroutine 12 12 100.0
pod n/a
total 51 51 100.0


line stmt bran cond sub pod time code
1             package common::header;
2              
3             # NOTE !!!WARNING!!! don't use indirect with strawberry perl
4             # https://rt.cpan.org/Public/Bug/Display.html?id=102321
5              
6 5     5   2339 use utf8;
  5         76  
  5         30  
7 5     5   203 use strict qw[refs subs vars];
  5         13  
  5         200  
8              
9 5     5   34 no warnings; ## no critic qw[TestingAndDebugging::ProhibitNoWarnings]
  5         12  
  5         391  
10             use warnings (
11 5         502 'all',
12             FATAL => qw[
13             closed
14             closure
15             debugging
16             digit
17             glob
18             inplace
19             internal
20             io
21             layer
22             malloc
23             pack
24             pipe
25             portable
26             printf
27             prototype
28             reserved
29             semicolon
30             taint
31             threads
32             unpack
33             utf8
34             ],
35             NONFATAL => qw[
36             exec
37             newline
38             unopened
39             ]
40 5     5   39 );
  5         11  
41              
42 5     5   2690 no if $^V ge 'v5.18', warnings => 'experimental';
  5         74  
  5         82  
43 5     5   493 use if $^V lt 'v5.23', warnings => 'experimental::autoderef', FATAL => 'experimental::autoderef';
  5         13  
  5         58  
44              
45 5     5   262 use if $^V ge 'v5.10', feature => ':all';
  5         13  
  5         56  
46 5     5   1197 no if $^V ge 'v5.16', feature => 'array_base';
  5         14  
  5         112  
47              
48 5     5   433 use if $^V ge 'v5.22', re => 'strict'; # NOTE https://rt.perl.org/Public/Bug/Display.html?id=128313
  5         13  
  5         54  
49              
50 5     5   3332 no multidimensional;
  5         16486  
  5         38  
51              
52             # TODO mro caller
53             BEGIN {
54 5     5   1123 eval <<"PERL"; ## no critic qw[BuiltinFunctions::ProhibitStringyEval ErrorHandling::RequireCheckingReturnValueOfEval]
  275     275   1576  
  275         997  
  275         953  
  275         5886  
  275         5447  
55             sub import {
56             local \$^W;
57              
58 5         139 \${^WARNING_BITS} = "@{[ join( q[], map "\\x$_", unpack '(H2)*', ${^WARNING_BITS}) ]}";
59              
60             \$^H |= $^H;
61              
62 5         58 @^H{ qw[@{[ join q[ ], keys %^H ]}] } = (@{[ join q[, ], values %^H ]});
  5         1058  
63              
64             return;
65             }
66              
67             1;
68             PERL
69              
70             # TODO re-export mro
71             # my $caller = $args{-caller} // caller;
72             # mro::set_mro( $caller, 'c3' ) if $^V ge 'v5.10';
73             # use if $^V ge 'v5.10', mro => 'c3';
74             }
75              
76             1;
77             ## -----SOURCE FILTER LOG BEGIN-----
78             ##
79             ## PerlCritic profile "common" policy violations:
80             ## +------+----------------------+----------------------------------------------------------------------------------------------------------------+
81             ## | Sev. | Lines | Policy |
82             ## |======+======================+================================================================================================================|
83             ## | 2 | 1 | Modules::RequireVersionVar - No package-scoped "$VERSION" variable found |
84             ## +------+----------------------+----------------------------------------------------------------------------------------------------------------+
85             ##
86             ## -----SOURCE FILTER LOG END-----
87             __END__
88             =pod
89              
90             =encoding utf8
91              
92             =head1 NAME
93              
94             common::header - re-exporting the set of standard perl pragmas
95              
96             =head1 SYNOPSIS
97              
98             use common::header;
99              
100             # or re-export
101              
102             common::header->import;
103              
104             =head1 DESCRIPTION
105              
106             =head1 ATTRIBUTES
107              
108             =head1 METHODS
109              
110             =head1 SEE ALSO
111              
112             common::sense
113              
114             =cut