Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 272c289

Browse files
committed
Remove use of 'tie' in perl for copyright.pl; instead use normal file
open/close.
1 parent da64fb9 commit 272c289

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/tools/copyright.pl

+7-5
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@
2222
find({wanted => \&wanted, no_chdir => 1}, '.');
2323

2424
sub wanted {
25-
return unless -f $File::Find::name;
25+
my $filename = $File::Find::name;
2626

27-
my @lines;
28-
tie @lines, Tie::File, $File::Find::name;
27+
# only regular files
28+
return if ! -f $filename;
2929

30-
foreach my $line (@lines) {
30+
open(my $FILE, '<', $filename) or die "Cannot open $filename";
31+
32+
foreach my $line (<$FILE>) {
3133
# We only care about lines with a copyright notice.
3234
next unless $line =~ m/$cc.*$pgdg/;
3335
# We stop when we've done one substitution. This is both for
@@ -37,7 +39,7 @@ sub wanted {
3739
last if $line =~ s/($cc\d{4})(, $pgdg)/$1-$year$2/;
3840
last if $line =~ s/($cc\d{4})-\d{4}(, $pgdg)/$1-$year$2/;
3941
}
40-
untie @lines;
42+
close($FILE) or die "Cannot close $filename";
4143
}
4244

4345
print "Manually update doc/src/sgml/legal.sgml and src/interfaces/libpq/libpq.rc.in too\n";

0 commit comments

Comments
 (0)