@@ -7,7 +7,8 @@ use File::Compare qw( compare );
7
7
use File::Copy qw( copy );
8
8
use File::Basename qw( dirname );
9
9
10
- sub iterdirs(&);
10
+ use feature 'signatures';
11
+ no warnings 'experimental::signatures';
11
12
12
13
my $rootdir = dirname($0);
13
14
@@ -37,15 +38,14 @@ unless (@destdirs) {
37
38
38
39
# Remove all installed ppport.h files
39
40
if ($opt{clean}) {
40
- iterdirs {
41
- my($dir, $fulldir) = @_;
41
+ iterdirs( sub ($dir, $fulldir) {
42
42
my $dest = File::Spec->catfile($fulldir, 'ppport.h');
43
43
if (-f $dest) {
44
44
print "removing ppport.h for $dir\n";
45
45
unlink $dest or warn "WARNING: could not remove $dest: $!\n";
46
46
1 while unlink $dest; # remove any remaining versions
47
47
}
48
- };
48
+ } ) ;
49
49
exit 0;
50
50
}
51
51
@@ -83,8 +83,7 @@ unless (-e 'ppport.h') {
83
83
}
84
84
85
85
# Now install the created ppport.h into extension directories
86
- iterdirs {
87
- my($dir, $fulldir) = @_;
86
+ iterdirs( sub ($dir, $fulldir) {
88
87
my $dest = File::Spec->catfile($fulldir, 'ppport.h');
89
88
if (compare('ppport.h', $dest)) {
90
89
print "installing ppport.h for $dir\n";
@@ -93,17 +92,15 @@ iterdirs {
93
92
else {
94
93
print "ppport.h in $dir is up-to-date\n";
95
94
}
96
- };
95
+ } ) ;
97
96
98
97
exit 0;
99
98
100
99
#---------------------------------------
101
100
# Iterate through extension directories
102
101
#---------------------------------------
103
- sub iterdirs(& )
102
+ sub iterdirs($code )
104
103
{
105
- my $code = shift;
106
-
107
104
for my $dir (@destdirs) {
108
105
my $fulldir = File::Spec->catdir($absroot, $dir);
109
106
if (-d $fulldir) {
@@ -118,9 +115,8 @@ sub iterdirs(&)
118
115
#----------------------------------------
119
116
# Read the list of extension directories
120
117
#----------------------------------------
121
- sub readlist
118
+ sub readlist($list)
122
119
{
123
- my $list = shift;
124
120
my @dirs;
125
121
open LIST, $list or die "$list: $!\n";
126
122
while (<LIST>) {
0 commit comments