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.20230106'; |
4
|
5
|
|
|
5
|
|
274035
|
use 5.010_000; |
|
5
|
|
|
|
|
50
|
|
5
|
|
|
|
|
|
|
|
6
|
5
|
|
|
5
|
|
33
|
use strict; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
118
|
|
7
|
5
|
|
|
5
|
|
25
|
use warnings; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
139
|
|
8
|
|
|
|
|
|
|
|
9
|
5
|
|
|
5
|
|
40
|
use mro (); |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
88
|
|
10
|
5
|
|
|
5
|
|
31
|
use feature (); |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
119
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# enable methods on filehandles; unnecessary when 5.14 autoloads them |
13
|
5
|
|
|
5
|
|
2347
|
use IO::File (); |
|
5
|
|
|
|
|
43224
|
|
|
5
|
|
|
|
|
119
|
|
14
|
5
|
|
|
5
|
|
49
|
use IO::Handle (); |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
1924
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
my $wanted_date; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub VERSION { |
19
|
5
|
|
|
5
|
0
|
15090
|
my ($self, $version) = @_; |
20
|
|
|
|
|
|
|
|
21
|
5
|
|
|
|
|
9
|
my $default = 2023; |
22
|
|
|
|
|
|
|
|
23
|
5
|
100
|
33
|
|
|
19
|
return $Modern::Perl::VERSION || $default unless defined $version; |
24
|
4
|
50
|
0
|
|
|
12
|
return $Modern::Perl::VERSION || $default if $version < 2009; |
25
|
|
|
|
|
|
|
|
26
|
4
|
50
|
|
|
|
28
|
$wanted_date = $version if (caller(1))[3] =~ /::BEGIN/; |
27
|
4
|
|
|
|
|
29
|
return $default; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub import { |
31
|
73
|
|
|
73
|
|
49061
|
my ($class, $date) = @_; |
32
|
73
|
100
|
|
|
|
189
|
$date = $wanted_date unless defined $date; |
33
|
|
|
|
|
|
|
|
34
|
73
|
|
|
|
|
155
|
my $feature_tag = validate_date( $date ); |
35
|
72
|
|
|
|
|
129
|
undef $wanted_date; |
36
|
|
|
|
|
|
|
|
37
|
72
|
|
|
|
|
575
|
warnings->import; |
38
|
72
|
|
|
|
|
289
|
strict->import; |
39
|
72
|
|
|
|
|
5468
|
feature->unimport( ':all' ); |
40
|
72
|
|
|
|
|
1928
|
feature->import( $feature_tag ); |
41
|
|
|
|
|
|
|
|
42
|
72
|
50
|
|
|
|
224
|
if ($feature_tag ge ':5.34') { |
43
|
0
|
|
|
|
|
0
|
feature->import( 'signatures' ); |
44
|
0
|
|
|
|
|
0
|
warnings->unimport( 'experimental::signatures' ); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
72
|
|
|
|
|
9108
|
mro::set_mro( scalar caller(), 'c3' ); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub unimport { |
51
|
1
|
|
|
1
|
|
22
|
warnings->unimport; |
52
|
1
|
|
|
|
|
7
|
strict->unimport; |
53
|
1
|
|
|
|
|
1584
|
feature->unimport; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub validate_date { |
57
|
73
|
|
|
73
|
0
|
621
|
my %dates = ( |
58
|
|
|
|
|
|
|
2009 => ':5.10', |
59
|
|
|
|
|
|
|
2010 => ':5.10', |
60
|
|
|
|
|
|
|
2011 => ':5.12', |
61
|
|
|
|
|
|
|
2012 => ':5.14', |
62
|
|
|
|
|
|
|
2013 => ':5.16', |
63
|
|
|
|
|
|
|
2014 => ':5.18', |
64
|
|
|
|
|
|
|
2015 => ':5.20', |
65
|
|
|
|
|
|
|
2016 => ':5.24', |
66
|
|
|
|
|
|
|
2017 => ':5.24', |
67
|
|
|
|
|
|
|
2018 => ':5.26', |
68
|
|
|
|
|
|
|
2019 => ':5.28', |
69
|
|
|
|
|
|
|
2020 => ':5.30', |
70
|
|
|
|
|
|
|
2021 => ':5.32', |
71
|
|
|
|
|
|
|
2022 => ':5.34', |
72
|
|
|
|
|
|
|
2023 => ':5.36', |
73
|
|
|
|
|
|
|
); |
74
|
|
|
|
|
|
|
|
75
|
73
|
|
|
|
|
138
|
my $date = shift; |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
# always enable unicode_strings when available |
78
|
73
|
100
|
|
|
|
145
|
unless ($date) { |
79
|
7
|
50
|
|
|
|
43
|
return ':5.12' if $] > 5.011003; |
80
|
0
|
|
|
|
|
0
|
return ':5.10'; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
66
|
|
|
|
|
147
|
my $year = substr $date, 0, 4; |
84
|
66
|
100
|
|
|
|
311
|
return $dates{$year} if exists $dates{$year}; |
85
|
|
|
|
|
|
|
|
86
|
1
|
|
|
|
|
17
|
die "Unknown date '$date' requested\n"; |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
1; |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
__END__ |