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   1627 use utf8;
  5         58  
  5         21  
7 5     5   165 use strict qw[refs subs vars];
  5         11  
  5         150  
8              
9 5     5   27 no warnings; ## no critic qw[TestingAndDebugging::ProhibitNoWarnings]
  5         9  
  5         279  
10             use warnings (
11 5         418 '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   25 );
  5         8  
41              
42 5     5   1937 no if $^V ge 'v5.18', warnings => 'experimental';
  5         53  
  5         54  
43 5     5   347 use if $^V lt 'v5.23', warnings => 'experimental::autoderef', FATAL => 'experimental::autoderef';
  5         8  
  5         37  
44              
45 5     5   186 use if $^V ge 'v5.10', feature => ':all';
  5         9  
  5         33  
46 5     5   762 no if $^V ge 'v5.16', feature => 'array_base';
  5         10  
  5         69  
47              
48 5     5   296 use if $^V ge 'v5.22', re => 'strict'; # NOTE https://rt.perl.org/Public/Bug/Display.html?id=128313
  5         7  
  5         38  
49              
50 5     5   2432 no multidimensional;
  5         12106  
  5         26  
51              
52             # TODO mro caller
53             BEGIN {
54 5     5   924 eval <<"PERL"; ## no critic qw[BuiltinFunctions::ProhibitStringyEval ErrorHandling::RequireCheckingReturnValueOfEval]
  275     275   1248  
  275         764  
  275         731  
  275         4500  
  275         4249  
55             sub import {
56             local \$^W;
57              
58 5         113 \${^WARNING_BITS} = "@{[ join( q[], map "\\x$_", unpack '(H2)*', ${^WARNING_BITS}) ]}";
59              
60             \$^H |= $^H;
61              
62 5         41 @^H{ qw[@{[ join q[ ], keys %^H ]}] } = (@{[ join q[, ], values %^H ]});
  5         770  
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