tests: switch to 3-argument open in test suite

The perl 2-argument open has been considered not-quite-deprecated since
the 3-argument form was introduced almost a quarter century ago.
This commit is contained in:
Dan Fandrich 2023-03-28 13:29:36 -07:00
parent b133f70a52
commit 0e3ae25337
21 changed files with 361 additions and 357 deletions

View file

@ -35,8 +35,8 @@ my %error; # from the include file
my %docs; # from libcurl-errors.3
sub getdocserrors {
open(F, "<$root/docs/libcurl/libcurl-errors.3");
while(<F>) {
open(my $f, "<", "$root/docs/libcurl/libcurl-errors.3");
while(<$f>) {
if($_ =~ /^.IP \"(CURL[EM]_[^ \t\"]*)/) {
my ($symbol) = ($1);
if($symbol =~ /OBSOLETE/) {
@ -47,12 +47,12 @@ sub getdocserrors {
}
}
}
close(F);
close($f);
}
sub getincludeerrors {
open(F, "<$root/docs/libcurl/symbols-in-versions");
while(<F>) {
open(my $f, "<", "$root/docs/libcurl/symbols-in-versions");
while(<$f>) {
if($_ =~ /^(CURL[EM]_[^ \t]*)[ \t]*([0-9.]+)[ \t]*(.*)/) {
my ($symbol, $added, $rest) = ($1,$2,$3);
if($rest =~ /^([0-9.]+)/) {
@ -63,7 +63,7 @@ sub getincludeerrors {
}
}
}
close(F);
close($f);
}
getincludeerrors();