| 1 | package Five::X; | ||||||||||
| 2 | |||||||||||
| 3 | 7 | our $VERSION = '0.01_01'; | |||||||||
| 4 | |||||||||||
| 5 | 7 | ▶ | use Exporter 'import'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 7 | 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 | 7 | my %experimental = ( | |||||||||
| 12 | '5.018' => [qw/experimental::smartmatch/], | ||||||||||
| 13 | '5.020' => [qw/experimental::autoderef/], | ||||||||||
| 14 | '5.022' => [qw/experimental::const_attr/], | ||||||||||
| 15 | ); | ||||||||||
| 16 | |||||||||||
| 17 | 3 | ▶ | sub experimental_versions { | ||||||||
|
Subroutine
experimental_versions: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 18 | 3 | return sort keys %experimental; | |||||||||
| 19 | } | ||||||||||
| 20 | |||||||||||
| 21 | 6 | ▶ | sub experimental_warnings { | ||||||||
|
Subroutine
experimental_warnings: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||
| 22 | 6 | my ($version) = @_; | |||||||||
| 23 | 6 | ▶ | return [ ] if !exists $experimental{$version}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | 6 | 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<experimental::> | ||||||||||
| 49 | class without a feature category. | ||||||||||
| 50 | |||||||||||
| 51 | =head2 experimental_warnings($version) | ||||||||||
| 52 | |||||||||||
| 53 | Returns a listref of the warnings in the C<experimental::> class for the given | ||||||||||
| 54 | perl version. | ||||||||||
| 55 | |||||||||||
| 56 | =head1 COPYRIGHT | ||||||||||
| 57 | |||||||||||
| 58 | (c) MMXV - Abe Timmerman <abeltje@cpan.org> | ||||||||||
| 59 | |||||||||||
| 60 | =cut | ||||||||||