| 1 | package Five::TwentyTwo; | ||||||||||||||||||||||||||||
| 2 | 1 | ▶ | use 5.022; | ||||||||||||||||||||||||||
|
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.22'; | ||||||||||||||||||||||||||
|
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
Condition33%1/3
@_ and $_[0] eq ":experimental"
MC/DC0%0/2
@_ and $_[0] eq ":experimental"
@_
$_[0] eq ":experimental"
Truth table33%1/3
A and B
A= @_B= $_[0] eq ":experimental"
| |||||||||||||||||||||||||||||
| 14 | 1 | push @features, qw( | |||||||||||||||||||||||||||
| 15 | lexical_subs postderef postderef_qq signatures | ||||||||||||||||||||||||||||
| 16 | bitwise refaliasing | ||||||||||||||||||||||||||||
| 17 | ); | ||||||||||||||||||||||||||||
| 18 | }; | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 1 | warnings->import(); | |||||||||||||||||||||||||||
| 21 | 1 | strict->import(); | |||||||||||||||||||||||||||
| 22 | 1 | ▶ | if (@features) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 23 | 1 | my @no_warnings = map "experimental::$_", grep !/_qq/, @features; | |||||||||||||||||||||||||||
| 24 | 1 | warnings->unimport(@no_warnings); | |||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 1 | for my $version (experimental_versions()) { | |||||||||||||||||||||||||||
| 27 | 2 | ▶ | next if $] < $version; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 28 | 2 | warnings->unimport(@{ experimental_warnings($version) }); | |||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||
| 31 | 0 | feature->import(':5.22', @features); | |||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 1 | 1; | |||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | =head1 NAME | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | Five::TwentyTwo - Enable 'strict', 'warnings' and 'features :5.22' in the calling code | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | package MyPackage; | ||||||||||||||||||||||||||||
| 43 | use Five::Eighteen; | ||||||||||||||||||||||||||||
| 44 | # strict, warnings and featere :5.22 | ||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | Perl 5.18 introduces experimental features that warn. These warnings can be | ||||||||||||||||||||||||||||
| 47 | switched off with special 'no warnings' catagories. Use the B<:experimental> | ||||||||||||||||||||||||||||
| 48 | import-tag to enable these features without warnings. | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | package MyPackage; | ||||||||||||||||||||||||||||
| 51 | use Five::TwentyTwo ':experimantal'; | ||||||||||||||||||||||||||||
| 52 | # now you also have: | ||||||||||||||||||||||||||||
| 53 | # 'lexical subs', 'postderef', 'postderef_qq', 'signatures', 'bitwise', | ||||||||||||||||||||||||||||
| 54 | # 'refaliasing' | ||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | =head1 COPYRIGHT | ||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | (c) MMXV - Abe Timmerman <abeltje@cpan.org> | ||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||
| 60 | =cut | ||||||||||||||||||||||||||||