File tree 1 file changed +7
-5
lines changed
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 22
22
find({wanted => \&wanted, no_chdir => 1}, ' .' );
23
23
24
24
sub wanted {
25
- return unless -f $File::Find::name ;
25
+ my $filename = $File::Find::name ;
26
26
27
- my @lines ;
28
- tie @lines , Tie::File, $File::Find::name ;
27
+ # only regular files
28
+ return if ! -f $filename ;
29
29
30
- foreach my $line (@lines ) {
30
+ open (my $FILE , ' <' , $filename ) or die " Cannot open $filename " ;
31
+
32
+ foreach my $line (<$FILE >) {
31
33
# We only care about lines with a copyright notice.
32
34
next unless $line =~ m /$cc .*$pgdg / ;
33
35
# We stop when we've done one substitution. This is both for
@@ -37,7 +39,7 @@ sub wanted {
37
39
last if $line =~ s / ($cc\d {4})(, $pgdg)/ $1 -$year$2 / ;
38
40
last if $line =~ s / ($cc\d {4})-\d {4}(, $pgdg)/ $1 -$year$2 / ;
39
41
}
40
- untie @lines ;
42
+ close ( $FILE ) or die " Cannot close $filename " ;
41
43
}
42
44
43
45
print " Manually update doc/src/sgml/legal.sgml and src/interfaces/libpq/libpq.rc.in too\n " ;
You can’t perform that action at this time.
0 commit comments