| 1 | package Code::Style::Kit::Parts::Perl526; | ||
| 2 | use strict; | ||
| 3 | use warnings; | ||
| 4 | our $VERSION = '1.0.3'; # VERSION | ||
| 5 | # ABSTRACT: use features from perl 5.26 | ||
| 6 | |||
| 7 | |||
| 8 | use Import::Into; | ||
| 9 | |||
| 10 | # use 5.26: say state switch unicode_strings unicode_eval evalbytes | ||
| 11 | # current_sub fc postderef_qq | ||
| 12 | sub feature_perl_5_26_default { 1 } | ||
| 13 | sub feature_perl_5_26_export { | ||
| 14 | my ($self, $caller) = @_; | ||
| 15 | require feature; | ||
| 16 | feature->import(':5.26'); | ||
| 17 | feature->unimport::out_of($caller,'switch'); # we don't want smartmatch! | ||
| 18 | |||
| 19 | feature->import::into($caller,'signatures'); | ||
| 20 | require experimental; | ||
| 21 | experimental->import::into($caller,'signatures'); | ||
| 22 | } | ||
| 23 | |||
| 24 | # if warnings are fatalised (e.g. by Code::Style::Kit::Parts::Common), | ||
| 25 | # disable warnings for the experimental features we want | ||
| 26 | sub feature_fatal_warnings_export { | ||
| 27 | my ($self, $caller) = @_; | ||
| 28 | |||
| 29 | require experimental; | ||
| 30 | experimental->import::into($caller,'signatures'); | ||
| 31 | } | ||
| 32 | |||
| 33 | 1; | ||
| 34 | |||
| 35 | __END__ |