From 0ada20387c31c638cfd7f6b4ae7e5cab5b318caf Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 29 Jun 2026 19:01:04 +0200 Subject: [PATCH] tidy-up: fix Perl syntax and formatting nits Closes #22376 --- .github/scripts/cleancmd.pl | 10 ++--- .github/scripts/randcurl.pl | 16 ++++---- .github/scripts/trimmarkdownheader.pl | 4 +- .github/scripts/verify-examples.pl | 4 +- docs/examples/version-check.pl | 4 +- docs/libcurl/symbols.pl | 2 +- scripts/extract-unit-protos | 2 +- scripts/managen | 2 +- scripts/mk-ca-bundle.pl | 14 +++---- scripts/release-notes.pl | 2 +- src/mkhelp.pl | 2 +- tests/devtest.pl | 2 +- tests/ftpserver.pl | 18 ++++----- tests/getpart.pm | 2 +- tests/libtest/test610.pl | 2 +- tests/libtest/test613.pl | 18 ++++----- tests/memanalyze.pl | 2 +- tests/runner.pm | 2 +- tests/runtests.pl | 2 +- tests/secureserver.pl | 2 +- tests/servers.pm | 8 ++-- tests/sshserver.pl | 54 +++++++++++++-------------- tests/test1119.pl | 2 +- tests/test1135.pl | 2 +- tests/test1165.pl | 8 ++-- tests/test1175.pl | 2 +- tests/test1477.pl | 4 +- tests/test1488.pl | 2 +- tests/testcurl.pl | 6 +-- tests/testutil.pm | 4 +- 30 files changed, 102 insertions(+), 102 deletions(-) diff --git a/.github/scripts/cleancmd.pl b/.github/scripts/cleancmd.pl index 722015b08f..c362484054 100755 --- a/.github/scripts/cleancmd.pl +++ b/.github/scripts/cleancmd.pl @@ -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() { 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() { chomp; @@ -49,7 +49,7 @@ while() { } close(O); -open(C, "<./.github/scripts/spellcheck.curl") +open(C, "<", './.github/scripts/spellcheck.curl') or die "cannot find spellcheck.curl"; while() { 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() { $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); } diff --git a/.github/scripts/randcurl.pl b/.github/scripts/randcurl.pl index 2c24a6b500..eaf9575456 100755 --- a/.github/scripts/randcurl.pl +++ b/.github/scripts/randcurl.pl @@ -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, "; 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, "; print @all; close(D); print "\n== curl-output == \n"; - open(D, "; print @out; close(D); diff --git a/.github/scripts/trimmarkdownheader.pl b/.github/scripts/trimmarkdownheader.pl index 89b2e7d9fd..36bc8de46c 100755 --- a/.github/scripts/trimmarkdownheader.pl +++ b/.github/scripts/trimmarkdownheader.pl @@ -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() { } close(F); -open(O, ">$f") or die; +open(O, ">", $f) or die; for my $l (@out) { print O $l; } diff --git a/.github/scripts/verify-examples.pl b/.github/scripts/verify-examples.pl index a23dc412f0..a734eefc96 100755 --- a/.github/scripts/verify-examples.pl +++ b/.github/scripts/verify-examples.pl @@ -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 \n"; while() { $iline++; diff --git a/docs/examples/version-check.pl b/docs/examples/version-check.pl index 125c3b5f7e..680bbb358b 100755 --- a/docs/examples/version-check.pl +++ b/docs/examples/version-check.pl @@ -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() { if(/\W(CURL[_A-Z0-9v]+)\W/) { diff --git a/docs/libcurl/symbols.pl b/docs/libcurl/symbols.pl index 2717ac3a55..1472d59bb1 100755 --- a/docs/libcurl/symbols.pl +++ b/docs/libcurl/symbols.pl @@ -47,7 +47,7 @@ use strict; use warnings; -open F, ") { if($_ =~ /^#define LIBCURL_VERSION \"([0-9.]*)/) { $version = $1; diff --git a/scripts/mk-ca-bundle.pl b/scripts/mk-ca-bundle.pl index 494f1d21d1..e2e9acf629 100755 --- a/scripts/mk-ca-bundle.pl +++ b/scripts/mk-ca-bundle.pl @@ -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 <) { 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() { 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() { 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); diff --git a/scripts/release-notes.pl b/scripts/release-notes.pl index c26c5037e8..706f344359 100755 --- a/scripts/release-notes.pl +++ b/scripts/release-notes.pl @@ -261,7 +261,7 @@ for my $n (1 .. $#refs) { } } -open(O, ">RELEASE-NOTES"); +open(O, ">", 'RELEASE-NOTES'); for my $l (@o) { print O $l; } diff --git a/src/mkhelp.pl b/src/mkhelp.pl index 9c60d7a64b..013ddc51c8 100755 --- a/src/mkhelp.pl +++ b/src/mkhelp.pl @@ -92,7 +92,7 @@ HEAD if(!($c % 12)) { print " "; } - printf(" 0x%02x,", 0+$num); + printf(" 0x%02x,", 0 + $num); if(!(++$c % 12)) { print "\n"; } diff --git a/tests/devtest.pl b/tests/devtest.pl index b71689c857..322b6904b6 100755 --- a/tests/devtest.pl +++ b/tests/devtest.pl @@ -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); } diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl index 0cb8cdc344..958160646f 100755 --- a/tests/ftpserver.pl +++ b/tests/ftpserver.pl @@ -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($_); } diff --git a/tests/getpart.pm b/tests/getpart.pm index 10838b2675..7bdf981746 100644 --- a/tests/getpart.pm +++ b/tests/getpart.pm @@ -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 $_; } diff --git a/tests/libtest/test610.pl b/tests/libtest/test610.pl index af63c3e6b3..2834ba4eca 100755 --- a/tests/libtest/test610.pl +++ b/tests/libtest/test610.pl @@ -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"; diff --git a/tests/libtest/test613.pl b/tests/libtest/test613.pl index a404bb6139..8647c9add2 100755 --- a/tests/libtest/test613.pl +++ b/tests/libtest/test613.pl @@ -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() { /^(.)(..).(..).(..).\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); diff --git a/tests/memanalyze.pl b/tests/memanalyze.pl index 15382e527a..c1988500fa 100755 --- a/tests/memanalyze.pl +++ b/tests/memanalyze.pl @@ -55,6 +55,6 @@ my $file = $ARGV[0] || ''; my @res = memanalyze($file, $verbose, $trace, $showlimit); -for (@res) { +for(@res) { print $_; } diff --git a/tests/runner.pm b/tests/runner.pm index 594e383f74..7cbc5067e1 100644 --- a/tests/runner.pm +++ b/tests/runner.pm @@ -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; diff --git a/tests/runtests.pl b/tests/runtests.pl index 4495001194..d7582ded96 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -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 !~ /^#/) { diff --git a/tests/secureserver.pl b/tests/secureserver.pl index 5aa82f4a0f..9b12b4425a 100755 --- a/tests/secureserver.pl +++ b/tests/secureserver.pl @@ -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); diff --git a/tests/servers.pm b/tests/servers.pm index 7aff9be429..99db988124 100644 --- a/tests/servers.pm +++ b/tests/servers.pm @@ -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); } diff --git a/tests/sshserver.pl b/tests/sshserver.pl index 2461b668b1..27a7fa81db 100755 --- a/tests/sshserver.pl +++ b/tests/sshserver.pl @@ -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, '#'; diff --git a/tests/test1119.pl b/tests/test1119.pl index 47ec214120..a1b09d0594 100755 --- a/tests/test1119.pl +++ b/tests/test1119.pl @@ -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+//; diff --git a/tests/test1135.pl b/tests/test1135.pl index 907a08d20b..ceb313cf8c 100755 --- a/tests/test1135.pl +++ b/tests/test1135.pl @@ -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() { s/CURL_DEPRECATED\(.*"\)//; diff --git a/tests/test1165.pl b/tests/test1165.pl index 99979dff06..259e13cc87 100755 --- a/tests/test1165.pl +++ b/tests/test1165.pl @@ -43,7 +43,7 @@ my $DOCS = "CURL-DISABLE.md"; sub scanconf { my ($f) = @_; - open S, "<$f"; + open(S, "<", $f); while() { 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() { 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() { 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() { $line++; diff --git a/tests/test1175.pl b/tests/test1175.pl index b929ff41ee..06db7c7d4c 100755 --- a/tests/test1175.pl +++ b/tests/test1175.pl @@ -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! } diff --git a/tests/test1477.pl b/tests/test1477.pl index 0973c9c951..a561cb8cde 100755 --- a/tests/test1477.pl +++ b/tests/test1477.pl @@ -43,7 +43,7 @@ my %manfrom; sub scanheader { my ($file) = @_; - open H, "<$file"; + open(H, "<", $file); my $line = 0; while() { $line++; @@ -63,7 +63,7 @@ sub scanheader { sub scanmanpage { my ($file) = @_; - open H, "<$file"; + open(H, "<", $file); my $line = 0; while() { $line++; diff --git a/tests/test1488.pl b/tests/test1488.pl index b940fb7f14..8542c6ee7f 100755 --- a/tests/test1488.pl +++ b/tests/test1488.pl @@ -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.]*)/) { diff --git a/tests/testcurl.pl b/tests/testcurl.pl index ae836e4411..0c7068a0ee 100755 --- a/tests/testcurl.pl +++ b/tests/testcurl.pl @@ -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+\"(.+)\".*$/) { diff --git a/tests/testutil.pm b/tests/testutil.pm index 2deed4ce95..bfff47db2a 100644 --- a/tests/testutil.pm +++ b/tests/testutil.pm @@ -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);