line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Modern::Perl; |
2
|
|
|
|
|
|
|
# ABSTRACT: enable all of the features of Modern Perl with one import |
3
|
|
|
|
|
|
|
$Modern::Perl::VERSION = '1.20220515'; |
4
|
5
|
|
|
5
|
|
237376
|
use 5.010_000; |
|
5
|
|
|
|
|
34
|
|
5
|
|
|
|
|
|
|
|
6
|
5
|
|
|
5
|
|
22
|
use strict; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
97
|
|
7
|
5
|
|
|
5
|
|
18
|
use warnings; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
119
|
|
8
|
|
|
|
|
|
|
|
9
|
5
|
|
|
5
|
|
23
|
use mro (); |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
88
|
|
10
|
5
|
|
|
5
|
|
23
|
use feature (); |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
106
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# enable methods on filehandles; unnecessary when 5.14 autoloads them |
13
|
5
|
|
|
5
|
|
1988
|
use IO::File (); |
|
5
|
|
|
|
|
38292
|
|
|
5
|
|
|
|
|
103
|
|
14
|
5
|
|
|
5
|
|
29
|
use IO::Handle (); |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
1872
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
my $wanted_date; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub VERSION { |
19
|
5
|
|
|
5
|
0
|
12095
|
my ($self, $version) = @_; |
20
|
|
|
|
|
|
|
|
21
|
5
|
100
|
50
|
|
|
22
|
return $Modern::Perl::VERSION || 2022 unless defined $version; |
22
|
4
|
50
|
0
|
|
|
11
|
return $Modern::Perl::VERSION || 2022 if $version < 2009; |
23
|
|
|
|
|
|
|
|
24
|
4
|
50
|
|
|
|
23
|
$wanted_date = $version if (caller(1))[3] =~ /::BEGIN/; |
25
|
4
|
|
|
|
|
23
|
return 2022; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub import { |
29
|
73
|
|
|
73
|
|
42878
|
my ($class, $date) = @_; |
30
|
73
|
100
|
|
|
|
168
|
$date = $wanted_date unless defined $date; |
31
|
|
|
|
|
|
|
|
32
|
73
|
|
|
|
|
127
|
my $feature_tag = validate_date( $date ); |
33
|
72
|
|
|
|
|
106
|
undef $wanted_date; |
34
|
|
|
|
|
|
|
|
35
|
72
|
|
|
|
|
547
|
warnings->import; |
36
|
72
|
|
|
|
|
242
|
strict->import; |
37
|
72
|
|
|
|
|
3658
|
feature->import( $feature_tag ); |
38
|
|
|
|
|
|
|
|
39
|
72
|
50
|
|
|
|
199
|
if ($feature_tag ge ':5.34') { |
40
|
0
|
|
|
|
|
0
|
feature->import( 'signatures' ); |
41
|
0
|
|
|
|
|
0
|
warnings->unimport( 'experimental::signatures' ); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
72
|
|
|
|
|
8347
|
mro::set_mro( scalar caller(), 'c3' ); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub unimport { |
48
|
1
|
|
|
1
|
|
19
|
warnings->unimport; |
49
|
1
|
|
|
|
|
5
|
strict->unimport; |
50
|
1
|
|
|
|
|
1325
|
feature->unimport; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub validate_date { |
54
|
73
|
|
|
73
|
0
|
486
|
my %dates = ( |
55
|
|
|
|
|
|
|
2009 => ':5.10', |
56
|
|
|
|
|
|
|
2010 => ':5.10', |
57
|
|
|
|
|
|
|
2011 => ':5.12', |
58
|
|
|
|
|
|
|
2012 => ':5.14', |
59
|
|
|
|
|
|
|
2013 => ':5.16', |
60
|
|
|
|
|
|
|
2014 => ':5.18', |
61
|
|
|
|
|
|
|
2015 => ':5.20', |
62
|
|
|
|
|
|
|
2016 => ':5.24', |
63
|
|
|
|
|
|
|
2017 => ':5.24', |
64
|
|
|
|
|
|
|
2018 => ':5.26', |
65
|
|
|
|
|
|
|
2019 => ':5.28', |
66
|
|
|
|
|
|
|
2020 => ':5.30', |
67
|
|
|
|
|
|
|
2021 => ':5.32', |
68
|
|
|
|
|
|
|
2022 => ':5.34', |
69
|
|
|
|
|
|
|
); |
70
|
|
|
|
|
|
|
|
71
|
73
|
|
|
|
|
106
|
my $date = shift; |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
# always enable unicode_strings when available |
74
|
73
|
100
|
|
|
|
119
|
unless ($date) { |
75
|
7
|
50
|
|
|
|
36
|
return ':5.12' if $] > 5.011003; |
76
|
0
|
|
|
|
|
0
|
return ':5.10'; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
66
|
|
|
|
|
109
|
my $year = substr $date, 0, 4; |
80
|
66
|
100
|
|
|
|
244
|
return $dates{$year} if exists $dates{$year}; |
81
|
|
|
|
|
|
|
|
82
|
1
|
|
|
|
|
15
|
die "Unknown date '$date' requested\n"; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
1; |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
__END__ |