File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 1
1
use strict; # satisfy linter
2
2
use warnings; # satisfy linter
3
3
4
+ =pod
5
+
6
+ Semantic sugar to simplify management of modules which changed their required Perl version
7
+ (directly or via dependencies)
8
+
9
+ requires_by_perl Module,
10
+ prior 5.010 => 'use version X',
11
+ prior 5.012 => 'use version Y',
12
+ otherwise do_not_install
13
+ ;
14
+
15
+ =cut
16
+
17
+ sub requires_by_perl {
18
+ my @requires = (shift );
19
+
20
+ while (@_ ) {
21
+ shift , next
22
+ unless @_ == 1 || $] < shift
23
+ ;
24
+
25
+ push @requires , shift // return ;
26
+ last ;
27
+ }
28
+
29
+ requires @requires ;
30
+ }
31
+
32
+ sub prior { @_ }
33
+ sub otherwise { @_ }
34
+ sub do_not_install { undef }
35
+
4
36
# Last versions which install on < 5.12
5
37
if ( " $] " < 5.012 ) {
6
38
requires ' Data::Section' , ' ==0.200007' ;
You can’t perform that action at this time.
0 commit comments