File Coverage

blib/lib/Five/X.pm
Criterion Covered Total %
statement 7 7 100.0
branch 1 2 50.0
condition n/a
subroutine 3 3 100.0
pod 2 2 100.0
total 13 14 92.8


line stmt bran cond sub pod time code
1             package Five::X;
2              
3             our $VERSION = '0.01_01';
4              
5 6     6   22 use Exporter 'import';
  6         7  
  6         792  
6             our @EXPORT = qw/ experimental_versions experimental_warnings /;
7              
8             # These are experimental warnings without a feature, and backward incompatible!
9             # I'd like to say: use Five::Ten ':experimental';
10             # and be able to use given/when on 5.18
11             my %experimental = (
12             '5.018' => [qw/experimental::smartmatch/],
13             '5.020' => [qw/experimental::autoderef/],
14             '5.022' => [qw/experimental::const_attr/],
15             );
16              
17             sub experimental_versions {
18 2     2 1 13 return sort keys %experimental;
19             }
20              
21             sub experimental_warnings {
22 4     4 1 5 my ($version) = @_;
23 4 50       7 return [ ] if !exists $experimental{$version};
24 4         29 return $experimental{$version};
25             }
26              
27             =head1 NAME
28              
29             FiveX - A set of modules that enable strict and warnings and features
30              
31             =head1 SYNOPSIS
32              
33             #! /usr/bin/perl
34             use Five::Ten; # use 5.010; use feature ':5.10'; use strict; use warnings;
35             say "Turned on features for 5.10";
36              
37             =head1 DESCRIPTION
38              
39             Either of these modules turns on strict, warnings and features in the calling package.
40              
41             =head2 use feature
42              
43             Starting with perl version 5.18, some features are experimental. These will
44             not be switched on by default, you'll have to add the ':experimental' tag.
45              
46             =head2 experimental_versions
47              
48             Returns an ordered list of versions that have warings in the C
49             class without a feature category.
50              
51             =head2 experimental_warnings($version)
52              
53             Returns a listref of the warnings in the C class for the given
54             perl version.
55              
56             =head1 COPYRIGHT
57              
58             (c) MMXV - Abe Timmerman
59              
60             =cut