File Coverage

blib/lib/Five/Eighteen.pm
Criterion Covered Total %
statement 29 29 100.0
branch 4 6 66.6
condition 1 3 33.3
subroutine 6 6 100.0
pod n/a
total 40 44 90.9


line stmt bran cond sub pod time code
1             package Five::Eighteen;
2 1     1   14980 use 5.018;
  1         3  
  1         31  
3 1     1   6 use warnings;
  1         1  
  1         35  
4 1     1   5 use strict;
  1         2  
  1         66  
5 1     1   5 use feature ':5.18';
  1         1  
  1         158  
6              
7 1     1   314 use Five::X;
  1         2  
  1         234  
8              
9             sub import {
10 1     1   6 my $class = shift;
11              
12 1         1 my @features;
13 1 50 33     6 if (@_ and $_[0] eq ':experimental') {
14 1         2 push @features, 'lexical_subs';
15             };
16              
17 1         9 warnings->import();
18 1         15 strict->import();
19 1 50       3 if (@features) {
20 1         3 my @no_warnings = map "experimental::$_", @features;
21 1         12 warnings->unimport(@no_warnings);
22              
23 1         2 for my $version (experimental_versions()) {
24 3 100       8 next if $] < $version;
25 2         2 warnings->unimport(@{ experimental_warnings($version) });
  2         3  
26             }
27             }
28 1         71 feature->import(':5.18', @features);
29             }
30              
31             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
54              
55             =cut