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.20200211'; |
4
|
5
|
|
|
5
|
|
218060
|
use 5.010_000; |
|
5
|
|
|
|
|
35
|
|
5
|
|
|
|
|
|
|
|
6
|
5
|
|
|
5
|
|
23
|
use strict; |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
102
|
|
7
|
5
|
|
|
5
|
|
20
|
use warnings; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
120
|
|
8
|
|
|
|
|
|
|
|
9
|
5
|
|
|
5
|
|
21
|
use mro (); |
|
5
|
|
|
|
|
20
|
|
|
5
|
|
|
|
|
77
|
|
10
|
5
|
|
|
5
|
|
21
|
use feature (); |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
74
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# enable methods on filehandles; unnecessary when 5.14 autoloads them |
13
|
5
|
|
|
5
|
|
1897
|
use IO::File (); |
|
5
|
|
|
|
|
34311
|
|
|
5
|
|
|
|
|
99
|
|
14
|
5
|
|
|
5
|
|
28
|
use IO::Handle (); |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
1341
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
my $wanted_date; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub VERSION { |
19
|
5
|
|
|
5
|
0
|
12357
|
my ($self, $version) = @_; |
20
|
|
|
|
|
|
|
|
21
|
5
|
100
|
50
|
|
|
16
|
return $Modern::Perl::VERSION || 2020 unless defined $version; |
22
|
4
|
50
|
0
|
|
|
11
|
return $Modern::Perl::VERSION || 2020 if $version < 2009; |
23
|
|
|
|
|
|
|
|
24
|
4
|
50
|
|
|
|
24
|
$wanted_date = $version if (caller(1))[3] =~ /::BEGIN/; |
25
|
4
|
|
|
|
|
24
|
return 2020; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub import { |
29
|
73
|
|
|
73
|
|
40222
|
my ($class, $date) = @_; |
30
|
73
|
100
|
|
|
|
175
|
$date = $wanted_date unless defined $date; |
31
|
|
|
|
|
|
|
|
32
|
73
|
|
|
|
|
136
|
my $feature_tag = validate_date( $date ); |
33
|
72
|
|
|
|
|
110
|
undef $wanted_date; |
34
|
|
|
|
|
|
|
|
35
|
72
|
|
|
|
|
479
|
warnings->import; |
36
|
72
|
|
|
|
|
230
|
strict->import; |
37
|
72
|
|
|
|
|
3563
|
feature->import( $feature_tag ); |
38
|
72
|
|
|
|
|
7304
|
mro::set_mro( scalar caller(), 'c3' ); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub unimport { |
42
|
1
|
|
|
1
|
|
18
|
warnings->unimport; |
43
|
1
|
|
|
|
|
5
|
strict->unimport; |
44
|
1
|
|
|
|
|
1267
|
feature->unimport; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub validate_date { |
48
|
73
|
|
|
73
|
0
|
451
|
my %dates = ( |
49
|
|
|
|
|
|
|
2009 => ':5.10', |
50
|
|
|
|
|
|
|
2010 => ':5.10', |
51
|
|
|
|
|
|
|
2011 => ':5.12', |
52
|
|
|
|
|
|
|
2012 => ':5.14', |
53
|
|
|
|
|
|
|
2013 => ':5.16', |
54
|
|
|
|
|
|
|
2014 => ':5.18', |
55
|
|
|
|
|
|
|
2015 => ':5.20', |
56
|
|
|
|
|
|
|
2016 => ':5.24', |
57
|
|
|
|
|
|
|
2017 => ':5.24', |
58
|
|
|
|
|
|
|
2018 => ':5.26', |
59
|
|
|
|
|
|
|
2019 => ':5.28', |
60
|
|
|
|
|
|
|
2020 => ':5.30', |
61
|
|
|
|
|
|
|
); |
62
|
|
|
|
|
|
|
|
63
|
73
|
|
|
|
|
127
|
my $date = shift; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
# always enable unicode_strings when available |
66
|
73
|
100
|
|
|
|
122
|
unless ($date) { |
67
|
7
|
50
|
|
|
|
35
|
return ':5.12' if $] > 5.011003; |
68
|
0
|
|
|
|
|
0
|
return ':5.10'; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
66
|
|
|
|
|
115
|
my $year = substr $date, 0, 4; |
72
|
66
|
100
|
|
|
|
240
|
return $dates{$year} if exists $dates{$year}; |
73
|
|
|
|
|
|
|
|
74
|
1
|
|
|
|
|
13
|
die "Unknown date '$date' requested\n"; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
1; |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
__END__ |