tidy-up: fix Perl syntax and formatting nits

Closes #22376
This commit is contained in:
Viktor Szakats 2026-06-29 19:01:04 +02:00
parent 4b0cf12ab1
commit 0ada20387c
No known key found for this signature in database
30 changed files with 102 additions and 102 deletions

View file

@ -15,7 +15,7 @@ use warnings;
my @asyms;
open(S, "<./docs/libcurl/symbols-in-versions")
open(S, "<", './docs/libcurl/symbols-in-versions')
or die "cannot find symbols-in-versions";
while(<S>) {
if(/^([^ ]*) /) {
@ -29,7 +29,7 @@ my @aopts = (
'--ftp-ssl-reqd', # old alias
);
open(O, "<./docs/options-in-versions")
open(O, "<", './docs/options-in-versions')
or die "cannot find options-in-versions";
while(<O>) {
chomp;
@ -49,7 +49,7 @@ while(<O>) {
}
close(O);
open(C, "<./.github/scripts/spellcheck.curl")
open(C, "<", './.github/scripts/spellcheck.curl')
or die "cannot find spellcheck.curl";
while(<C>) {
if(/^\#/) {
@ -75,7 +75,7 @@ sub process {
my $sepcount = 0;
my $out;
my $line = 0;
open(F, "<$f") or die;
open(F, "<", $f) or die;
while(<F>) {
$line++;
@ -115,7 +115,7 @@ sub process {
map { $out =~ s/\b$_\b//g; } (@syms);
if(!$ignore) {
open(O, ">$f") or die;
open(O, ">", $f) or die;
print O $out;
close(O);
}

View file

@ -80,7 +80,7 @@ sub addarg {
"0123456789-";
my $len = getnum(20) + 2;
my $o;
for (1 .. $len) {
for(1 .. $len) {
$o .= substr($nice, getnum(length($nice)), 1);
}
return "--$o";
@ -93,7 +93,7 @@ sub randarg {
",-?#$%!@ ";
my $len = getnum(20);
my $o = '';
for (1 .. $len) {
for(1 .. $len) {
$o .= substr($nice, getnum(length($nice)), 1);
}
return "\'$o\'";
@ -122,7 +122,7 @@ sub runone {
$totalargs += $nargs;
$totalcmds++;
for (1 .. $nargs) {
for(1 .. $nargs) {
my $o = getnum($nopts);
my $option = $opt[$o];
my $ar = "";
@ -154,7 +154,7 @@ sub runone {
print "CMD: $cmd\n";
print "RC: $rc\n";
print "== curl-output == \n";
open(D, "<curl-output");
open(D, "<", 'curl-output');
my @out = <D>;
print @out;
close(D);
@ -166,11 +166,11 @@ sub runconfig {
my $a;
my $nargs = getnum(80) + 1;
open(C, ">config");
open(C, ">", 'config');
$totalargs += $nargs;
$totalcmds++;
for (1 .. $nargs) {
for(1 .. $nargs) {
my $o = getnum($nopts);
my $option = $opt[$o];
my $ar = "";
@ -204,12 +204,12 @@ sub runconfig {
print "CMD: $cmd\n";
print "RC: $rc\n";
print "== config == \n";
open(D, "<config");
open(D, "<", 'config');
my @all = <D>;
print @all;
close(D);
print "\n== curl-output == \n";
open(D, "<curl-output");
open(D, "<", 'curl-output');
my @out = <D>;
print @out;
close(D);

View file

@ -12,7 +12,7 @@ use warnings;
my $f = $ARGV[0] || '';
open(F, "<$f") or die;
open(F, "<", $f) or die;
my @out;
my $line = 0;
@ -37,7 +37,7 @@ while(<F>) {
}
close(F);
open(O, ">$f") or die;
open(O, ">", $f) or die;
for my $l (@out) {
print O $l;
}

View file

@ -54,8 +54,8 @@ sub extract {
my $l = 0;
my $iline = 0;
my $fail = 0;
open(F, "<$f") or die "failed opening input file $f : $!";
open(O, ">$cfile") or die "failed opening output file $cfile : $!";
open(F, "<", $f) or die "failed opening input file $f : $!";
open(O, ">", $cfile) or die "failed opening output file $cfile : $!";
print O "#include <curl/curl.h>\n";
while(<F>) {
$iline++;

View file

@ -41,7 +41,7 @@
use strict;
use warnings;
open(S, "<../libcurl/symbols-in-versions") or die;
open(S, "<", '../libcurl/symbols-in-versions') or die;
my %doc;
my %rem;
@ -70,7 +70,7 @@ sub age {
}
my %used;
open(C, "<$ARGV[0]") or die;
open(C, "<", $ARGV[0]) or die;
while(<C>) {
if(/\W(CURL[_A-Z0-9v]+)\W/) {

View file

@ -47,7 +47,7 @@
use strict;
use warnings;
open F, "<symbols-in-versions";
open(F, "<", 'symbols-in-versions');
sub str2num {
my ($str) = @_;

View file

@ -35,7 +35,7 @@ my $error;
sub scanfile {
my ($file) = @_;
open(F, "<$file") or die "$file failed";
open(F, "<", $file) or die "$file failed";
my $unit = 0;
my $line = 0;
my $unitref = 0;

View file

@ -1365,7 +1365,7 @@ if($ENV{'CURL_MAKETGZ_VERSION'}) {
$version = $ENV{'CURL_MAKETGZ_VERSION'};
}
else {
open(INC, "<$include/curl/curlver.h") or die "no $include/curl/curlver.h";
open(INC, "<", "$include/curl/curlver.h") or die "no $include/curl/curlver.h";
while(<INC>) {
if($_ =~ /^#define LIBCURL_VERSION \"([0-9.]*)/) {
$version = $1;

View file

@ -224,7 +224,7 @@ sub parse_csv_param($$@) {
} split(',', $param_string);
# Find all values which are not in the list of valid values or "ALL"
my @invalid = grep { !is_in_list($_,"ALL",@valid_values) } @values;
my @invalid = grep { !is_in_list($_, "ALL", @valid_values) } @values;
if(scalar(@invalid) > 0) {
# Tell the user which parameters were invalid and print the standard help
@ -233,7 +233,7 @@ sub parse_csv_param($$@) {
HELP_MESSAGE();
}
@values = @valid_values if(is_in_list("ALL",@values));
@values = @valid_values if(is_in_list("ALL", @values));
return @values;
}
@ -403,7 +403,7 @@ my $format = $opt_t ? "plain text and " : "";
if($stdout) {
open(CRT, '> -') or die "Could not open STDOUT: $!\n";
} else {
open(CRT,">$crt.~") or die "Could not open $crt.~: $!\n";
open(CRT, ">", "$crt.~") or die "Could not open $crt.~: $!\n";
}
print CRT <<EOT;
##
@ -575,9 +575,9 @@ while(<TXT>) {
last;
}
if(/^CKA_TRUST_([A-Z_]+)\s+CK_TRUST\s+CKT_NSS_([A-Z_]+)\s*$/) {
if(!is_in_list($1,@valid_mozilla_trust_purposes)) {
if(!is_in_list($1, @valid_mozilla_trust_purposes)) {
report "Warning: Unrecognized trust purpose for cert: $caname. Trust purpose: $1. Trust Level: $2";
} elsif(!is_in_list($2,@valid_mozilla_trust_levels)) {
} elsif(!is_in_list($2, @valid_mozilla_trust_levels)) {
report "Warning: Unrecognized trust level for cert: $caname. Trust purpose: $1. Trust Level: $2";
} else {
push @{$trust_purposes_by_level{$2}}, $1;
@ -635,7 +635,7 @@ while(<TXT>) {
print TMP $pem;
close(TMP) or die "Could not close openssl pipe: $!";
if(!$stdout) {
open(CRT, ">>$crt.~") or die "Could not open $crt.~: $!";
open(CRT, ">>", "$crt.~") or die "Could not open $crt.~: $!";
}
}
$pipe = "|$openssl x509 -text -inform PEM";
@ -647,7 +647,7 @@ while(<TXT>) {
print TMP $pem;
close(TMP) or die "Could not close openssl pipe: $!";
if(!$stdout) {
open(CRT, ">>$crt.~") or die "Could not open $crt.~: $!";
open(CRT, ">>", "$crt.~") or die "Could not open $crt.~: $!";
}
}
report "Processed: $caname" if($opt_v);

View file

@ -261,7 +261,7 @@ for my $n (1 .. $#refs) {
}
}
open(O, ">RELEASE-NOTES");
open(O, ">", 'RELEASE-NOTES');
for my $l (@o) {
print O $l;
}

View file

@ -92,7 +92,7 @@ HEAD
if(!($c % 12)) {
print " ";
}
printf(" 0x%02x,", 0+$num);
printf(" 0x%02x,", 0 + $num);
if(!(++$c % 12)) {
print "\n";
}

View file

@ -108,7 +108,7 @@ sub parseprotocols {
# Initialize @protocols from the curl binary under test
#
sub init_protocols {
for (qx($CURL -V 2>$dev_null)) {
for(qx($CURL -V 2>$dev_null)) {
if(m/^Protocols: (.*)$/) {
parseprotocols($1);
}

View file

@ -180,9 +180,9 @@ my $ftptargetdir = "";
# that they are closely related and relationship is a bit awkward.
#
my $datasockf_state = 'STOPPED'; # see datasockf_state() sub
my $datasockf_mode = 'none'; # ['none','active','passive']
my $datasockf_runs = 'no'; # ['no','yes']
my $datasockf_conn = 'no'; # ['no','yes']
my $datasockf_mode = 'none'; # ['none', 'active', 'passive']
my $datasockf_runs = 'no'; # ['no', 'yes']
my $datasockf_conn = 'no'; # ['no', 'yes']
#**********************************************************************
# global vars used for signal handling
@ -330,7 +330,7 @@ sub read_mainsockf {
$timeout = $sockfilt_timeout + ($nbytes >> 12);
}
if(eXsysread($FH, $scalar, $nbytes, $timeout) != $nbytes) {
my ($fcaller, $lcaller) = (caller)[1,2];
my ($fcaller, $lcaller) = (caller)[1, 2];
logmsg "Error: read_mainsockf() failure at $fcaller " .
"line $lcaller. Due to eXsysread() failure\n";
return 0;
@ -354,7 +354,7 @@ sub read_datasockf {
$timeout = $sockfilt_timeout + ($nbytes >> 12);
}
if(eXsysread($FH, $scalar, $nbytes, $timeout) != $nbytes) {
my ($fcaller, $lcaller) = (caller)[1,2];
my ($fcaller, $lcaller) = (caller)[1, 2];
logmsg "Error: read_datasockf() failure at $fcaller " .
"line $lcaller. Due to eXsysread() failure\n";
return 0;
@ -373,7 +373,7 @@ sub sysread_or_die {
$result = sysread($$FH, $$scalar, $length);
if(not defined $result) {
($fcaller, $lcaller) = (caller)[1,2];
($fcaller, $lcaller) = (caller)[1, 2];
logmsg "Failed to read input\n";
logmsg "Error: $srvrname server, sysread error: $!\n";
logmsg "Exited from sysread_or_die() at $fcaller " .
@ -388,7 +388,7 @@ sub sysread_or_die {
exit;
}
elsif($result == 0) {
($fcaller, $lcaller) = (caller)[1,2];
($fcaller, $lcaller) = (caller)[1, 2];
logmsg "Failed to read input\n";
logmsg "Error: $srvrname server, read zero\n";
logmsg "Exited from sysread_or_die() at $fcaller " .
@ -520,7 +520,7 @@ sub senddata {
}
else {
# pause between each byte
for (split(//,$l)) {
for(split(//, $l)) {
sockfiltsecondary $_;
Time::HiRes::sleep($datadelay);
}
@ -1252,7 +1252,7 @@ sub FETCH_imap {
@data = getreplydata($selected);
}
for (@data) {
for(@data) {
$size += length($_);
}

View file

@ -392,7 +392,7 @@ sub writearray {
my ($filename, $arrayref) = @_;
open(my $temp, ">", $filename) or die "Failure writing file";
binmode($temp,":raw"); # Cygwin fix
binmode($temp, ":raw"); # Cygwin fix
for(@$arrayref) {
print $temp $_;
}

View file

@ -46,7 +46,7 @@ while(@ARGV) {
}
elsif($cmd eq "move") {
my $arg2 = shift @ARGV;
move($arg,$arg2) or die "$!";
move($arg, $arg2) or die "$!";
}
elsif($cmd eq "gone") {
! -e $arg or die "Path $arg exists";

View file

@ -50,30 +50,30 @@ if($ARGV[0] eq "prepare") {
mkdir "asubdir" or errout "$!";
chmod 0777, "asubdir";
open(FILE, ">plainfile.txt") or errout "$!";
open(FILE, ">", 'plainfile.txt') or errout "$!";
binmode FILE;
print FILE "Test file to support curl test suite\n";
close(FILE);
# The mtime is specifically chosen to be an even number so that it can be
# represented exactly on a FAT file system.
utime time, timegm(0,0,12,1,0,100), "plainfile.txt";
utime time, timegm(0, 0, 12, 1, 0, 100), "plainfile.txt";
chmod 0666, "plainfile.txt";
open(FILE, ">emptyfile.txt") or errout "$!";
open(FILE, ">", 'emptyfile.txt') or errout "$!";
binmode FILE;
close(FILE);
# The mtime is specifically chosen to be an even number so that it can be
# represented exactly on a FAT file system.
utime time, timegm(0,0,12,1,0,100), "emptyfile.txt";
utime time, timegm(0, 0, 12, 1, 0, 100), "emptyfile.txt";
chmod 0666, "emptyfile.txt";
open(FILE, ">rofile.txt") or errout "$!";
open(FILE, ">", 'rofile.txt') or errout "$!";
binmode FILE;
print FILE "Read-only test file to support curl test suite\n";
close(FILE);
# The mtime is specifically chosen to be an even number so that it can be
# represented exactly on a FAT file system.
utime time, timegm(0,0,12,31,11,100), "rofile.txt";
utime time, timegm(0, 0, 12, 31, 11, 100), "rofile.txt";
chmod 0444, "rofile.txt";
if($^O eq 'cygwin') {
system('chattr', ('+r', 'rofile.txt'));
@ -120,7 +120,7 @@ elsif($ARGV[0] eq "postprocess") {
# -r-?r-?r-? 12 U U 47 Dec 31 2000 rofile.txt
my @canondir;
open(IN, "<$logfile") or die "$!";
open(IN, "<", $logfile) or die "$!";
while(<IN>) {
/^(.)(..).(..).(..).\s*(\S+)\s+\S+\s+\S+\s+(\S+)\s+(\S+\s+\S+\s+\S+)\s+(.*)$/;
if($1 eq "d") {
@ -137,7 +137,7 @@ elsif($ARGV[0] eq "postprocess") {
# some systems (e.g. on Windows)
# Erase user and group names, as they are not consistent across
# all test systems
my $line = sprintf("%s%s???????%5d U U %15d %s %s\n", $1,$2,$5,$6,$7,$8);
my $line = sprintf("%s%s???????%5d U U %15d %s %s\n", $1, $2, $5, $6, $7, $8);
push @canondir, $line;
} else {
# Unexpected format; pass it through and let the test fail
@ -148,7 +148,7 @@ elsif($ARGV[0] eq "postprocess") {
@canondir = sort {substr($a, 57) cmp substr($b, 57)} @canondir;
my $newfile = $logfile . ".new";
open(OUT, ">$newfile") or die "$!";
open(OUT, ">", $newfile) or die "$!";
print OUT join('', @canondir);
close(OUT);

View file

@ -55,6 +55,6 @@ my $file = $ARGV[0] || '';
my @res = memanalyze($file, $verbose, $trace, $showlimit);
for (@res) {
for(@res) {
print $_;
}

View file

@ -486,7 +486,7 @@ sub torture {
logmsg " $count functions to make fail\n";
}
for (@torture_tests) {
for(@torture_tests) {
my $limit = $_;
my $fail;
my $dumped_core;

View file

@ -2759,7 +2759,7 @@ if(!$listonly) {
# Output information about the curl build
#
if(!$listonly && $buildinfo) {
if(open(my $fd, "<", "../buildinfo.txt")) {
if(open(my $fd, "<", '../buildinfo.txt')) {
while(my $line = <$fd>) {
chomp $line;
if($line && $line !~ /^#/) {

View file

@ -337,7 +337,7 @@ if($stunnel_version >= 400) {
print uc($proto) ." server (stunnel $ver_major.$ver_minor)\n";
print "cmd: $cmd\n";
print "stunnel config at $conffile:\n";
open (my $writtenconf, '<', $conffile) or die "$ssltext could not open the config file after writing\n";
open(my $writtenconf, '<', $conffile) or die "$ssltext could not open the config file after writing\n";
print <$writtenconf>;
print "\n";
close ($writtenconf);

View file

@ -334,7 +334,7 @@ sub startnew {
if(not defined $child) {
logmsg "startnew: fork() failure detected\n";
return (-1,-1);
return (-1, -1);
}
if(0 == $child) {
@ -366,7 +366,7 @@ sub startnew {
Time::HiRes::sleep($timeout);
if(checkdied($child)) {
logmsg "startnew: child process has failed to start\n" if($verbose);
return (-1,-1);
return (-1, -1);
}
}
@ -384,7 +384,7 @@ sub startnew {
logmsg "startnew: child process has died, server might start up\n"
if($verbose);
# We cannot abort waiting for the server with a
# return (-1,-1);
# return (-1, -1);
# because the server might have forked and could still start
# up normally. Instead, reduce the amount of time we remain
# waiting.
@ -1671,7 +1671,7 @@ sub runsshserver {
my $sshd = find_sshd();
if($sshd) {
($sshdid,$sshdvernum,$sshdverstr,$sshderror) = sshversioninfo($sshd);
($sshdid, $sshdvernum, $sshdverstr, $sshderror) = sshversioninfo($sshd);
logmsg $sshderror if($sshderror);
}

View file

@ -698,33 +698,33 @@ sub sshd_supports_opt {
#***************************************************************************
# Kerberos Authentication support may have not been built into sshd
#
if(sshd_supports_opt('KerberosAuthentication','no')) {
if(sshd_supports_opt('KerberosAuthentication', 'no')) {
push @cfgarr, 'KerberosAuthentication no';
}
if(sshd_supports_opt('KerberosGetAFSToken','no')) {
if(sshd_supports_opt('KerberosGetAFSToken', 'no')) {
push @cfgarr, 'KerberosGetAFSToken no';
}
if(sshd_supports_opt('KerberosOrLocalPasswd','no')) {
if(sshd_supports_opt('KerberosOrLocalPasswd', 'no')) {
push @cfgarr, 'KerberosOrLocalPasswd no';
}
if(sshd_supports_opt('KerberosTgtPassing','no')) {
if(sshd_supports_opt('KerberosTgtPassing', 'no')) {
push @cfgarr, 'KerberosTgtPassing no';
}
if(sshd_supports_opt('KerberosTicketCleanup','yes')) {
if(sshd_supports_opt('KerberosTicketCleanup', 'yes')) {
push @cfgarr, 'KerberosTicketCleanup yes';
}
#***************************************************************************
# Andrew File System support may have not been built into sshd
#
if(sshd_supports_opt('AFSTokenPassing','no')) {
if(sshd_supports_opt('AFSTokenPassing', 'no')) {
push @cfgarr, 'AFSTokenPassing no';
}
#***************************************************************************
# S/Key authentication support may have not been built into sshd
#
if(sshd_supports_opt('SkeyAuthentication','no')) {
if(sshd_supports_opt('SkeyAuthentication', 'no')) {
push @cfgarr, 'SkeyAuthentication no';
}
@ -732,23 +732,23 @@ if(sshd_supports_opt('SkeyAuthentication','no')) {
# GSSAPI Authentication support may have not been built into sshd
#
my $sshd_builtwith_GSSAPI;
if(sshd_supports_opt('GSSAPIAuthentication','no')) {
if(sshd_supports_opt('GSSAPIAuthentication', 'no')) {
push @cfgarr, 'GSSAPIAuthentication no';
$sshd_builtwith_GSSAPI = 1;
}
if(sshd_supports_opt('GSSAPICleanupCredentials','yes')) {
if(sshd_supports_opt('GSSAPICleanupCredentials', 'yes')) {
push @cfgarr, 'GSSAPICleanupCredentials yes';
}
if(sshd_supports_opt('GSSAPIKeyExchange','no')) {
if(sshd_supports_opt('GSSAPIKeyExchange', 'no')) {
push @cfgarr, 'GSSAPIKeyExchange no';
}
if(sshd_supports_opt('GSSAPIStoreDelegatedCredentials','no')) {
if(sshd_supports_opt('GSSAPIStoreDelegatedCredentials', 'no')) {
push @cfgarr, 'GSSAPIStoreDelegatedCredentials no';
}
if(sshd_supports_opt('GSSCleanupCreds','yes')) {
if(sshd_supports_opt('GSSCleanupCreds', 'yes')) {
push @cfgarr, 'GSSCleanupCreds yes';
}
if(sshd_supports_opt('GSSUseSessionCredCache','no')) {
if(sshd_supports_opt('GSSUseSessionCredCache', 'no')) {
push @cfgarr, 'GSSUseSessionCredCache no';
}
push @cfgarr, '#';
@ -760,54 +760,54 @@ if(sshd_supports_opt('AddressFamily','any')) {
# Address family must be specified before ListenAddress
splice @cfgarr, 11, 0, 'AddressFamily any';
}
if(sshd_supports_opt('Compression','no')) {
if(sshd_supports_opt('Compression', 'no')) {
push @cfgarr, 'Compression no';
}
if(sshd_supports_opt('KbdInteractiveAuthentication','no')) {
if(sshd_supports_opt('KbdInteractiveAuthentication', 'no')) {
push @cfgarr, 'KbdInteractiveAuthentication no';
}
if(sshd_supports_opt('KeepAlive','no')) {
if(sshd_supports_opt('KeepAlive', 'no')) {
push @cfgarr, 'KeepAlive no';
}
if(sshd_supports_opt('LookupClientHostnames','no')) {
if(sshd_supports_opt('LookupClientHostnames', 'no')) {
push @cfgarr, 'LookupClientHostnames no';
}
if(sshd_supports_opt('MaxAuthTries','10')) {
push @cfgarr, 'MaxAuthTries 10';
}
if(sshd_supports_opt('PAMAuthenticationViaKbdInt','no')) {
if(sshd_supports_opt('PAMAuthenticationViaKbdInt', 'no')) {
push @cfgarr, 'PAMAuthenticationViaKbdInt no';
}
if(sshd_supports_opt('PermitTunnel','no')) {
if(sshd_supports_opt('PermitTunnel', 'no')) {
push @cfgarr, 'PermitTunnel no';
}
if(sshd_supports_opt('PermitUserEnvironment','no')) {
if(sshd_supports_opt('PermitUserEnvironment', 'no')) {
push @cfgarr, 'PermitUserEnvironment no';
}
if(sshd_supports_opt('RhostsAuthentication','no')) {
if(sshd_supports_opt('RhostsAuthentication', 'no')) {
push @cfgarr, 'RhostsAuthentication no';
}
if(sshd_supports_opt('TCPKeepAlive','no')) {
if(sshd_supports_opt('TCPKeepAlive', 'no')) {
push @cfgarr, 'TCPKeepAlive no';
}
if(sshd_supports_opt('UseDNS','no')) {
if(sshd_supports_opt('UseDNS', 'no')) {
push @cfgarr, 'UseDNS no';
}
if(sshd_supports_opt('UsePAM','no')) {
if(sshd_supports_opt('UsePAM', 'no')) {
push @cfgarr, 'UsePAM no';
}
if($sshdid =~ /OpenSSH/) {
# http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6492415
if(sshd_supports_opt('UsePrivilegeSeparation','no')) {
if(sshd_supports_opt('UsePrivilegeSeparation', 'no')) {
push @cfgarr, 'UsePrivilegeSeparation no';
}
}
if(sshd_supports_opt('VerifyReverseMapping','no')) {
if(sshd_supports_opt('VerifyReverseMapping', 'no')) {
push @cfgarr, 'VerifyReverseMapping no';
}
if(sshd_supports_opt('X11UseLocalhost','yes')) {
if(sshd_supports_opt('X11UseLocalhost', 'yes')) {
push @cfgarr, 'X11UseLocalhost yes';
}
push @cfgarr, '#';

View file

@ -66,7 +66,7 @@ my %rem;
# included by it, which *should* be all headers
sub scanenum {
my ($file) = @_;
open my $h_in, "-|", "$Cpreprocessor $i$file" or die "Cannot preprocess $file";
open(my $h_in, "-|", "$Cpreprocessor $i$file") or die "Cannot preprocess $file";
while(<$h_in>) {
if(/enum\s+(\S+\s+)?{/ .. /}/) {
s/^\s+//;

View file

@ -68,7 +68,7 @@ my $misses = 0;
my @out;
foreach my $f (@incs) {
open H, "<$f" or die;
open(H, "<", $f) or die;
my $first = "";
while(<H>) {
s/CURL_DEPRECATED\(.*"\)//;

View file

@ -43,7 +43,7 @@ my $DOCS = "CURL-DISABLE.md";
sub scanconf {
my ($f) = @_;
open S, "<$f";
open(S, "<", $f);
while(<S>) {
if(/(CURL_DISABLE_[A-Z0-9_]+)/g) {
my ($sym) = ($1);
@ -68,7 +68,7 @@ sub scan_configure {
sub scanconf_cmake {
my ($hashr, $f) = @_;
open S, "<$f";
open(S, "<", $f);
while(<S>) {
if(/(CURL_DISABLE_[A-Z0-9_]+)/g) {
my ($sym) = ($1);
@ -95,7 +95,7 @@ my %whitelisted = (
sub scan_file {
my ($source) = @_;
open F, "<$source";
open(F, "<", $source);
while(<F>) {
while(s/(CURL_DISABLE_[A-Z0-9_]+)//) {
my ($sym) = ($1);
@ -127,7 +127,7 @@ sub scan_sources {
}
sub scan_docs {
open F, "<$root/docs/$DOCS";
open(F, "<", "$root/docs/$DOCS");
my $line = 0;
while(<F>) {
$line++;

View file

@ -52,7 +52,7 @@ sub getincludeerrors {
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);
my ($symbol, $added, $rest) = ($1, $2, $3);
if($rest =~ /^([0-9.]+)/) {
# removed!
}

View file

@ -43,7 +43,7 @@ my %manfrom;
sub scanheader {
my ($file) = @_;
open H, "<$file";
open(H, "<", $file);
my $line = 0;
while(<H>) {
$line++;
@ -63,7 +63,7 @@ sub scanheader {
sub scanmanpage {
my ($file) = @_;
open H, "<$file";
open(H, "<", $file);
my $line = 0;
while(<H>) {
$line++;

View file

@ -111,7 +111,7 @@ allversions($versions);
scanman_md_dir("$root/docs/libcurl");
scanman_md_dir("$root/docs/libcurl/opts");
open my $s, "<", "$root/docs/libcurl/symbols-in-versions";
open(my $s, "<", "$root/docs/libcurl/symbols-in-versions");
while(<$s>) {
chomp;
if(/^(\S+) +([0-9.]*)/) {

View file

@ -443,7 +443,7 @@ if($git) {
# get the last 5 commits for show (even if no pull was made)
@commits = qx(git log --pretty=oneline --abbrev-commit -5);
logit "The most recent ares git commits:";
for (@commits) {
for(@commits) {
chomp ($_);
logit " $_";
}
@ -479,7 +479,7 @@ if($git) {
} else {
# Show snapshot git commit when available
if(open (my $f, '<', "docs/tarball-commit.txt")) {
if(open(my $f, '<', "docs/tarball-commit.txt")) {
my $commit = <$f>;
chomp $commit;
logit "The most recent curl git commits:";
@ -490,7 +490,7 @@ if($git) {
# Set timestamp to the one in curlver.h if this is not a git test build.
if((-f "include/curl/curlver.h") &&
(open(my $f, "<", "include/curl/curlver.h"))) {
open(my $f, "<", "include/curl/curlver.h")) {
while(<$f>) {
chomp;
if($_ =~ /^\#define\s+LIBCURL_TIMESTAMP\s+\"(.+)\".*$/) {

View file

@ -243,7 +243,7 @@ sub exerunner {
sub get_sha256_base64 {
my ($file_path) = @_;
return encode_base64(sha256(do { local $/; open my $fh, '<:raw', $file_path or die $!; <$fh> }), "");
return encode_base64(sha256(do { local $/; open(my $fh, '<:raw', $file_path) or die $!; <$fh> }), "");
}
sub subsha256base64file {
@ -260,7 +260,7 @@ sub subsha256base64file {
sub get_file_content {
my ($file_path) = @_;
my $content = do { local $/; open my $fh, '<', $file_path or die $!; <$fh> };
my $content = do { local $/; open(my $fh, '<', $file_path) or die $!; <$fh> };
$content =~ s/(^|-----END .*?-----[\r\n]?)(.*?)(-----BEGIN .*?-----|$)/$1$3/gs;
$content =~ s/\r\n/\n/g;
chomp($content);