Eighteen.pm

filter: Statementstmt 96.5% 28 / 29 Branchbran 50.0% 3 / 6 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 82.6% 38 / 46 CC 6 SCAR 14.1
CC
6
Cov
84%
import
6.6
BEGIN
1.0
BEGIN
1.0
CRAP 4.1
« Twelve.pm ↑ Summary Twenty.pm »
1 package Five::Eighteen;
2 1 ▶use 5.018;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use feature ':5.18';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶use Five::X;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 ▶sub import {
Subroutine import: called CC=6 SCAR=18.9
10 1 my $class = shift;
11  
12 1 my @features;
13 1 ▶ if (@_ and $_[0] eq ':experimental') {
Branch: 1 branch
BranchTrueFalseTotal
if (@_ and $_[0] eq ":experimental") 1 0 1
Condition33%1/3
@_ and $_[0] eq ":experimental"
!ll&&!rl&&r
001
MC/DC0%0/2
@_ and $_[0] eq ":experimental"
@_ $_[0] eq ":experimental"
Truth table33%1/3
A and B
A= @_B= $_[0] eq ":experimental"
ABresult
0X0
100
111
14 1 push @features, 'lexical_subs';
15 };
16  
17 1 warnings->import();
18 1 strict->import();
19 1 ▶ if (@features) {
Branch: 1 branch
BranchTrueFalseTotal
if (@features) 1 0 1
20 1 my @no_warnings = map "experimental::$_", @features;
21 1 warnings->unimport(@no_warnings);
22  
23 1 for my $version (experimental_versions()) {
24 2 ▶ next if $] < $version;
Branch: 1 branch
BranchTrueFalseTotal
if $] < $version 0 2 2
25 2 warnings->unimport(@{ experimental_warnings($version) });
26 }
27 }
28 0 feature->import(':5.18', @features);
29 }
30  
31 1 1;
32  
33 =head1 NAME
34  
35 Five::Eightteen - Enable 'strict', 'warnings' and 'features :5.18' in the calling code
36  
37 =head1 SYNOPSIS
38  
39 package MyPackage;
40 use Five::Eighteen;
41 # strict, warnings and featere :5.18
42  
43 Perl 5.18 introduces experimental features that warn. These warnings can be
44 switched off with special 'no warnings' catagories. Use the B<:experimental>
45 import-tag to enable these features without warnings.
46  
47 package MyPackage;
48 use Five::Eighteen ':experimantal';
49 # now you also have 'lexical subs'
50  
51 =head1 COPYRIGHT
52  
53 (c) MMXV - Abe Timmerman <abeltje@cpan.org>
54  
55 =cut
« Twelve.pm ↑ Summary Twenty.pm »