From 678e63934cc4bd1941b20c5111d37a6e530d2a5d Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 15 Jun 2026 01:26:04 +0200 Subject: [PATCH] perl: `|| die` -> `or die` Usage was fifty-fifty between these syntaxes before this patch. Closes #22036 --- .github/scripts/cleancmd.pl | 6 +++--- docs/examples/version-check.pl | 4 ++-- scripts/cdall | 2 +- scripts/checksrc-all.pl | 4 ++-- scripts/checksrc.pl | 2 +- scripts/completion.pl | 10 +++++----- scripts/extract-unit-protos | 2 +- scripts/managen | 2 +- scripts/singleuse.pl | 2 +- tests/certs/genserv.pl | 2 +- tests/getpart.pm | 4 ++-- tests/libtest/test1013.pl | 4 ++-- tests/libtest/test1022.pl | 4 ++-- tests/libtest/test610.pl | 10 +++++----- tests/libtest/test613.pl | 6 +++--- tests/runner.pm | 18 +++++++++--------- tests/runtests.pl | 18 +++++++++--------- tests/secureserver.pl | 2 +- tests/servers.pm | 4 ++-- tests/sshserver.pl | 2 +- tests/test1119.pl | 4 ++-- tests/test1135.pl | 4 ++-- tests/test1165.pl | 4 ++-- tests/test1167.pl | 4 ++-- tests/test1222.pl | 2 +- tests/test1477.pl | 2 +- tests/test1707.pl | 2 +- tests/test745.pl | 6 +++--- tests/test971.pl | 2 +- 29 files changed, 69 insertions(+), 69 deletions(-) diff --git a/.github/scripts/cleancmd.pl b/.github/scripts/cleancmd.pl index 988d456204..d6ddeb7274 100755 --- a/.github/scripts/cleancmd.pl +++ b/.github/scripts/cleancmd.pl @@ -16,7 +16,7 @@ use warnings; my @asyms; open(S, "<./docs/libcurl/symbols-in-versions") - || die "cannot find symbols-in-versions"; + or die "cannot find symbols-in-versions"; while() { if(/^([^ ]*) /) { push @asyms, $1; @@ -30,7 +30,7 @@ my @aopts = ( ); open(O, "<./docs/options-in-versions") - || die "cannot find options-in-versions"; + or die "cannot find options-in-versions"; while() { chomp; if(/^([^ ]+)/) { @@ -50,7 +50,7 @@ while() { close(O); open(C, "<./.github/scripts/spellcheck.curl") - || die "cannot find spellcheck.curl"; + or die "cannot find spellcheck.curl"; while() { if(/^\#/) { next; diff --git a/docs/examples/version-check.pl b/docs/examples/version-check.pl index a80f3ae632..125c3b5f7e 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") || 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]") || die; +open(C, "<$ARGV[0]") or die; while() { if(/\W(CURL[_A-Z0-9v]+)\W/) { diff --git a/scripts/cdall b/scripts/cdall index 15111a5c42..53e6e36929 100755 --- a/scripts/cdall +++ b/scripts/cdall @@ -30,7 +30,7 @@ use warnings; sub convert { my ($dir) = @_; - opendir(my $dh, $dir) || die "could not open $dir"; + opendir(my $dh, $dir) or die "could not open $dir"; my @cd = grep { /\.md\z/ && -f "$dir/$_" } readdir($dh); closedir $dh; diff --git a/scripts/checksrc-all.pl b/scripts/checksrc-all.pl index 5982384fe1..fd80c1b427 100755 --- a/scripts/checksrc-all.pl +++ b/scripts/checksrc-all.pl @@ -13,7 +13,7 @@ use Cwd 'abs_path'; my @files; my $is_git = 0; if(system('git rev-parse --is-inside-work-tree >/dev/null 2>&1') == 0) { - open(O, '-|', 'git', 'ls-files', '*.[ch]') || die; push @files, ; close(O); + open(O, '-|', 'git', 'ls-files', '*.[ch]') or die; push @files, ; close(O); $is_git = 1; } else { @@ -34,7 +34,7 @@ my $anyfailed = 0; for my $dir (@dirs) { if($is_git) { @files = (); - open(O, '-|', 'git', 'ls-files', ":(glob)$dir/*.[ch]") || die; push @files, ; close(O); + open(O, '-|', 'git', 'ls-files', ":(glob)$dir/*.[ch]") or die; push @files, ; close(O); chomp(@files); } else { diff --git a/scripts/checksrc.pl b/scripts/checksrc.pl index 2f2c218fea..46d02ae3c8 100755 --- a/scripts/checksrc.pl +++ b/scripts/checksrc.pl @@ -541,7 +541,7 @@ sub scanfile { printf "Checking file: $file\n"; } - open(my $R, '<', $file) || die "failed to open $file"; + open(my $R, '<', $file) or die "failed to open $file"; my $incomment = 0; my @copyright = (); diff --git a/scripts/completion.pl b/scripts/completion.pl index 27e2f062e7..203f2acfb6 100755 --- a/scripts/completion.pl +++ b/scripts/completion.pl @@ -80,21 +80,21 @@ sub parse_main_opts { my (@files, @list); my ($dir_handle, $file_content); - opendir($dir_handle, $opts_dir) || die "Unable to open dir: $opts_dir due to error: $!"; + opendir($dir_handle, $opts_dir) or die "Unable to open dir: $opts_dir due to error: $!"; @files = readdir($dir_handle); - closedir($dir_handle) || die "Unable to close handle on dir: $opts_dir due to error: $!"; + closedir($dir_handle) or die "Unable to close handle on dir: $opts_dir due to error: $!"; # We want regular files that end with .md and do not start with an underscore # Edge case: MANPAGE.md does not start with an underscore but also is not documentation for an option @files = grep { $_ =~ /\.md$/i && !/^_/ && -f "$opts_dir/$_" && $_ ne "MANPAGE.md" } @files; for my $file (@files) { - open(my $doc_handle, '<', "$opts_dir/$file") || die "Unable to open file: $file due to error: $!"; + open(my $doc_handle, '<', "$opts_dir/$file") or die "Unable to open file: $file due to error: $!"; $file_content = join('', <$doc_handle>); - close($doc_handle) || die "Unable to close file: $file due to error: $!"; + close($doc_handle) or die "Unable to close file: $file due to error: $!"; # Extract the curldown header section demarcated by --- - $file_content =~ /^---\s*\n(.*?)\n---\s*\n/s || die "Unable to parse file $file"; + $file_content =~ /^---\s*\n(.*?)\n---\s*\n/s or die "Unable to parse file $file"; $file_content = $1; my ($short, $long, $arg, $desc); diff --git a/scripts/extract-unit-protos b/scripts/extract-unit-protos index b9154012f4..79c6605794 100755 --- a/scripts/extract-unit-protos +++ b/scripts/extract-unit-protos @@ -35,7 +35,7 @@ my $error; sub scanfile { my ($file) = @_; - open(F, "<$file") || die "$file failed"; + open(F, "<$file") or die "$file failed"; my $unit = 0; my $line = 0; my $unitref = 0; diff --git a/scripts/managen b/scripts/managen index 2da6ec9354..d05e8b9386 100755 --- a/scripts/managen +++ b/scripts/managen @@ -1365,7 +1365,7 @@ if($ENV{'CURL_MAKETGZ_VERSION'}) { $version = $ENV{'CURL_MAKETGZ_VERSION'}; } else { - open(INC, "<$include/curl/curlver.h") || die "no $include/curl/curlver.h"; + open(INC, "<$include/curl/curlver.h") or die "no $include/curl/curlver.h"; while() { if($_ =~ /^#define LIBCURL_VERSION \"([0-9.]*)/) { $version = $1; diff --git a/scripts/singleuse.pl b/scripts/singleuse.pl index a1d2194d4e..fc6cc7f111 100755 --- a/scripts/singleuse.pl +++ b/scripts/singleuse.pl @@ -182,7 +182,7 @@ sub doublecheck { return @also; } -open(N, '-|', 'nm', $file) || die; +open(N, '-|', 'nm', $file) or die; my %exist; my %uses; diff --git a/tests/certs/genserv.pl b/tests/certs/genserv.pl index 96e77449aa..6e8ceec315 100755 --- a/tests/certs/genserv.pl +++ b/tests/certs/genserv.pl @@ -52,7 +52,7 @@ my $PREFIX; sub redir { my $outfn = shift if($_[0] =~ /^>/); my $hideerr = shift if($_[0] =~ /^2>/); - open(my $outfd, $outfn) || die if($outfn); + open(my $outfd, $outfn) or die if($outfn); my $pid = open3(my $in, my $out, my $err = gensym, @_); if(!$hideerr) { while(<$err>) { print STDERR $_; }; } if($outfn) { while(<$out>) { print $outfd $_; }; close($outfd); } diff --git a/tests/getpart.pm b/tests/getpart.pm index 74c7f6cb23..fc98da210c 100644 --- a/tests/getpart.pm +++ b/tests/getpart.pm @@ -386,12 +386,12 @@ sub compareparts { sub writearray { my ($filename, $arrayref) = @_; - open(my $temp, ">", $filename) || die "Failure writing file"; + open(my $temp, ">", $filename) or die "Failure writing file"; binmode($temp,":raw"); # Cygwin fix for(@$arrayref) { print $temp $_; } - close($temp) || die "Failure writing file"; + close($temp) or die "Failure writing file"; } # diff --git a/tests/libtest/test1013.pl b/tests/libtest/test1013.pl index 154c4227a6..b6bd5be7ff 100755 --- a/tests/libtest/test1013.pl +++ b/tests/libtest/test1013.pl @@ -36,7 +36,7 @@ my $what = $ARGV[2]; # Read the output of curl --version my $curl_protocols = ""; -open(CURL, $ARGV[1]) || die "Cannot get curl $what list\n"; +open(CURL, $ARGV[1]) or die "Cannot get curl $what list\n"; while() { $curl_protocols = $_ if(/$what:/i); } @@ -48,7 +48,7 @@ my @curl = split / /,$1; # Read the output of curl-config my @curl_config; -open(CURLCONFIG, '-|', 'sh', $ARGV[0], "--$what") || die "Cannot get curl-config $what list\n"; +open(CURLCONFIG, '-|', 'sh', $ARGV[0], "--$what") or die "Cannot get curl-config $what list\n"; while() { chomp; $_ = lc($_) if($what eq "protocols"); # accept uppercase protocols in curl-config diff --git a/tests/libtest/test1022.pl b/tests/libtest/test1022.pl index 49e295433b..a74a180e1d 100755 --- a/tests/libtest/test1022.pl +++ b/tests/libtest/test1022.pl @@ -34,7 +34,7 @@ if($#ARGV != 2) { my $what = $ARGV[2]; # Read the output of curl --version -open(CURL, $ARGV[1]) || die "Cannot open curl --version list in $ARGV[1]\n"; +open(CURL, $ARGV[1]) or die "Cannot open curl --version list in $ARGV[1]\n"; $_ = ; chomp; /libcurl\/([\.\d]+((-DEV)|(-rc\d)|(-\d+))?)/; @@ -44,7 +44,7 @@ close CURL; my $curlconfigversion; # Read the output of curl-config --version/--vernum -open(CURLCONFIG, '-|', 'sh', $ARGV[0], "--$what") || die "Cannot get curl-config --$what list\n"; +open(CURLCONFIG, '-|', 'sh', $ARGV[0], "--$what") or die "Cannot get curl-config --$what list\n"; $_ = ; chomp; my $filever = $_; diff --git a/tests/libtest/test610.pl b/tests/libtest/test610.pl index 10f665620a..af63c3e6b3 100755 --- a/tests/libtest/test610.pl +++ b/tests/libtest/test610.pl @@ -36,20 +36,20 @@ while(@ARGV) { my $cmd = shift @ARGV; my $arg = shift @ARGV; if($cmd eq "mkdir") { - mkdir $arg || die "$!"; + mkdir $arg or die "$!"; } elsif($cmd eq "rmdir") { - rmdir $arg || die "$!"; + rmdir $arg or die "$!"; } elsif($cmd eq "rm") { - unlink $arg || die "$!"; + unlink $arg or die "$!"; } elsif($cmd eq "move") { my $arg2 = shift @ARGV; - move($arg,$arg2) || die "$!"; + move($arg,$arg2) or die "$!"; } elsif($cmd eq "gone") { - ! -e $arg || die "Path $arg exists"; + ! -e $arg or die "Path $arg exists"; } else { print "Unsupported command $cmd\n"; exit 1; diff --git a/tests/libtest/test613.pl b/tests/libtest/test613.pl index bec12b9c5a..314f3829ac 100755 --- a/tests/libtest/test613.pl +++ b/tests/libtest/test613.pl @@ -94,7 +94,7 @@ elsif($ARGV[0] eq "postprocess") { unlink "$dirname/plainfile.txt"; rmdir "$dirname/asubdir"; - rmdir $dirname || die "$!"; + rmdir $dirname or die "$!"; if($#ARGV >= 3) { # Verify mtime if requested my $checkfile = $ARGV[2]; @@ -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") || 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") { @@ -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") || die "$!"; + open(OUT, ">$newfile") or die "$!"; print OUT join('', @canondir); close(OUT); diff --git a/tests/runner.pm b/tests/runner.pm index 6fa68670e9..fd665b9484 100644 --- a/tests/runner.pm +++ b/tests/runner.pm @@ -649,11 +649,11 @@ sub singletest_preprocess { @entiretest = prepro($testnum, @entiretest); # save the new version - open(my $fulltesth, ">", $otest) || die "Failure writing test file"; + open(my $fulltesth, ">", $otest) or die "Failure writing test file"; foreach my $bytes (@entiretest) { print $fulltesth pack('a*', $bytes) or die "Failed to print '$bytes': $!"; } - close($fulltesth) || die "Failure writing test file"; + close($fulltesth) or die "Failure writing test file"; # in case the process changed the file, reload it loadtest("$LOGDIR/test${testnum}"); @@ -1001,14 +1001,14 @@ sub singletest_run { open(my $cmdlog, ">", "$LOGDIR/$CURLLOG") || die "Failure writing log file"; print $cmdlog "$CMDLINE\n"; - close($cmdlog) || die "Failure writing log file"; + close($cmdlog) or die "Failure writing log file"; my $dumped_core; my $cmdres; if($gdbthis) { my $gdbinit = "$TESTDIR/gdbinit$testnum"; - open(my $gdbcmd, ">", "$LOGDIR/gdbcmd") || die "Failure writing gdb file"; + open(my $gdbcmd, ">", "$LOGDIR/gdbcmd") or die "Failure writing gdb file"; if($gdbthis == 1) { # gdb mode print $gdbcmd "set args $cmdargs\n"; @@ -1019,7 +1019,7 @@ sub singletest_run { # lldb mode print $gdbcmd "set args $cmdargs\n"; } - close($gdbcmd) || die "Failure writing gdb file"; + close($gdbcmd) or die "Failure writing gdb file"; } # Flush output. @@ -1083,9 +1083,9 @@ sub singletest_clean { logmsg "core dumped\n"; if(0 && $gdb) { logmsg "running gdb for post-mortem analysis:\n"; - open(my $gdbcmd, ">", "$LOGDIR/gdbcmd2") || die "Failure writing gdb file"; + open(my $gdbcmd, ">", "$LOGDIR/gdbcmd2") or die "Failure writing gdb file"; print $gdbcmd "bt\n"; - close($gdbcmd) || die "Failure writing gdb file"; + close($gdbcmd) or die "Failure writing gdb file"; runclient("$gdb --directory libtest -x $LOGDIR/gdbcmd2 -batch " . shell_quote($DBGCURL) . " core "); # unlink("$LOGDIR/gdbcmd2"); } @@ -1336,7 +1336,7 @@ sub controlleripccall { my $margs = freeze \@_; # Send IPC call via pipe - length($margs) < 1000 || die "A large IPC write risks blocking on some platforms"; + length($margs) < 1000 or die "A large IPC write risks blocking on some platforms"; my $err; while(! defined ($err = syswrite($controllerw{$runnerid}, (pack "L", length($margs)) . $margs)) || $err <= 0) { if((!defined $err && ! $!{EINTR}) || (defined $err && $err == 0)) { @@ -1407,7 +1407,7 @@ sub runnerar_ready { $maxfileno = $fd; } } - $maxfileno || die "Internal error: no runners are available to wait on\n"; + $maxfileno or die "Internal error: no runners are available to wait on\n"; # Wait for any pipe from any runner to be ready # This may be interrupted and return EINTR, but this is ignored and the diff --git a/tests/runtests.pl b/tests/runtests.pl index 32695e2a52..f660fa6e26 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -392,7 +392,7 @@ sub showdiff { my $file1 = "$logdir/check-generated"; my $file2 = "$logdir/check-expected"; - open(my $temp, ">", $file1) || die "Failure writing diff file"; + open(my $temp, ">", $file1) or die "Failure writing diff file"; for(@$firstref) { my $l = $_; $l =~ s/\r/[CR]/g; @@ -401,9 +401,9 @@ sub showdiff { print $temp $l; print $temp "\n"; } - close($temp) || die "Failure writing diff file"; + close($temp) or die "Failure writing diff file"; - open($temp, ">", $file2) || die "Failure writing diff file"; + open($temp, ">", $file2) or die "Failure writing diff file"; for(@$secondref) { my $l = $_; $l =~ s/\r/[CR]/g; @@ -412,7 +412,7 @@ sub showdiff { print $temp $l; print $temp "\n"; } - close($temp) || die "Failure writing diff file"; + close($temp) or die "Failure writing diff file"; my @out = qx(diff -u $file2 $file1 2>$dev_null); if(!$out[0]) { @@ -561,7 +561,7 @@ sub checksystemfeatures { $CURLVERSION = $1; $CURLVERNUM = $CURLVERSION; $CURLVERNUM =~ s/^([0-9.]+)(.*)/$1/; # leading dots and numbers - $curl =~ s/^(.*)(libcurl.*)/$1/g || die "Failure determining curl binary version"; + $curl =~ s/^(.*)(libcurl.*)/$1/g or die "Failure determining curl binary version"; $libcurl = $2; if($curl =~ /win32|Windows|windows|mingw(32|64)/) { @@ -1294,7 +1294,7 @@ sub singletest_check { my $loadfile = $hash{'loadfile'}; if($loadfile) { - open(my $tmp, "<", $loadfile) || die "Cannot open file $loadfile: $!"; + open(my $tmp, "<", $loadfile) or die "Cannot open file $loadfile: $!"; @validstdout = <$tmp>; close($tmp); @@ -2347,7 +2347,7 @@ sub createrunners { # sub pickrunner { my ($testnum) = @_; - scalar(@runnersidle) || die "No runners available"; + scalar(@runnersidle) or die "No runners available"; return pop @runnersidle; } @@ -2678,7 +2678,7 @@ if(!$randseed) { open(my $curlvh, "-|", exerunner() . shell_quote($CURL) . " --version 2>$dev_null") || die "could not get curl version!"; my @c = <$curlvh>; - close($curlvh) || die "could not get curl version!"; + close($curlvh) or die "could not get curl version!"; # use the first line of output and get the md5 out of it my $str = md5($c[0]); $randseed += unpack('S', $str); # unsigned 16-bit value @@ -2855,7 +2855,7 @@ sub disabledtests { if($TESTCASES eq "all") { # Get all commands and find out their test numbers - opendir(DIR, $TESTDIR) || die "cannot opendir $TESTDIR: $!"; + opendir(DIR, $TESTDIR) or die "cannot opendir $TESTDIR: $!"; my @cmds = grep { /^test([0-9]+)$/ && -f "$TESTDIR/$_" } readdir(DIR); closedir(DIR); diff --git a/tests/secureserver.pl b/tests/secureserver.pl index d0da33e352..5025d47b4b 100755 --- a/tests/secureserver.pl +++ b/tests/secureserver.pl @@ -365,7 +365,7 @@ if($tstunnel_windows) { # Put an "exec" in front of the command so that the child process # keeps this child's process ID by being tied to the spawned shell. - exec("exec $cmd") || die "Cannot exec() $cmd: $!"; + exec("exec $cmd") or die "Cannot exec() $cmd: $!"; # exec() creates a new process, but ties the existence of the # new process to the parent waiting perl.exe and sh.exe processes. diff --git a/tests/servers.pm b/tests/servers.pm index 454931aeb0..474a12c377 100644 --- a/tests/servers.pm +++ b/tests/servers.pm @@ -351,7 +351,7 @@ sub startnew { # Put an "exec" in front of the command so that the child process # keeps this child's process ID. - exec("exec $cmd") || die "Cannot exec() $cmd: $!"; + exec("exec $cmd") or die "Cannot exec() $cmd: $!"; # exec() should never return back here to this process. We protect # ourselves by calling die() in case something goes really bad. @@ -362,7 +362,7 @@ sub startnew { if($fakepidfile) { if(open(my $out, ">", $pidfile)) { print $out $child . "\n"; - close($out) || die "Failure writing pidfile"; + close($out) or die "Failure writing pidfile"; logmsg "startnew: $pidfile faked with pid=$child\n" if($verbose); } else { diff --git a/tests/sshserver.pl b/tests/sshserver.pl index 743f6356de..2461b668b1 100755 --- a/tests/sshserver.pl +++ b/tests/sshserver.pl @@ -1185,7 +1185,7 @@ if($sshdid =~ /OpenSSH-Windows/) { # Put an "exec" in front of the command so that the child process # keeps this child's process ID by being tied to the spawned shell. - exec("exec $cmd") || die "Cannot exec() $cmd: $!"; + exec("exec $cmd") or die "Cannot exec() $cmd: $!"; # exec() creates a new process, but ties the existence of the # new process to the parent waiting perl.exe and sh.exe processes. diff --git a/tests/test1119.pl b/tests/test1119.pl index 4797c758bd..75bca88a67 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" || 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+//; @@ -76,7 +76,7 @@ sub scanenum { push @syms, $_; } } - close $h_in || die "Error preprocessing $file"; + close $h_in or die "Error preprocessing $file"; } sub scanheader { diff --git a/tests/test1135.pl b/tests/test1135.pl index 152adef463..907a08d20b 100755 --- a/tests/test1135.pl +++ b/tests/test1135.pl @@ -51,7 +51,7 @@ if(!defined $root) { } $root = "$root/include/curl"; -opendir(D, $root) || die "Cannot open directory $root: $!\n"; +opendir(D, $root) or die "Cannot open directory $root: $!\n"; my @dir = readdir(D); closedir(D); @@ -68,7 +68,7 @@ my $misses = 0; my @out; foreach my $f (@incs) { - open H, "<$f" || die; + open H, "<$f" or die; my $first = ""; while() { s/CURL_DEPRECATED\(.*"\)//; diff --git a/tests/test1165.pl b/tests/test1165.pl index e3f45b2ada..ef6b34f328 100755 --- a/tests/test1165.pl +++ b/tests/test1165.pl @@ -56,7 +56,7 @@ sub scanconf { } sub scan_configure { - opendir(my $m, "$root/m4") || die "Cannot opendir $root/m4: $!"; + opendir(my $m, "$root/m4") or die "Cannot opendir $root/m4: $!"; my @m4 = grep { /\.m4$/ } readdir($m); closedir $m; scanconf("$root/configure.ac"); @@ -110,7 +110,7 @@ sub scan_file { sub scan_dir { my ($dir) = @_; - opendir(my $dh, $dir) || die "Cannot opendir $dir: $!"; + opendir(my $dh, $dir) or die "Cannot opendir $dir: $!"; my @cfiles = grep { /\.[ch]\z/ && -f "$dir/$_" } readdir($dh); closedir $dh; for my $f (sort @cfiles) { diff --git a/tests/test1167.pl b/tests/test1167.pl index eea5fe45f1..06b2b2b6cd 100755 --- a/tests/test1167.pl +++ b/tests/test1167.pl @@ -113,7 +113,7 @@ sub scanenums { } } } - close H_IN || die "Error preprocessing $file"; + close H_IN or die "Error preprocessing $file"; } sub scanheader { @@ -134,7 +134,7 @@ sub scanheader { close H; } -opendir(my $dh, $incdir) || die "Cannot opendir $incdir: $!"; +opendir(my $dh, $incdir) or die "Cannot opendir $incdir: $!"; my @hfiles = grep { /\.h$/ } readdir($dh); closedir $dh; diff --git a/tests/test1222.pl b/tests/test1222.pl index d34fb7bca4..a601688ee6 100755 --- a/tests/test1222.pl +++ b/tests/test1222.pl @@ -258,7 +258,7 @@ if(!glob("$libdocdir/*.3")) { } # Get header filenames, -opendir(my $dh, $incdir) || die "Cannot opendir $incdir"; +opendir(my $dh, $incdir) or die "Cannot opendir $incdir"; my @hfiles = grep { /\.h$/ } readdir($dh); closedir $dh; diff --git a/tests/test1477.pl b/tests/test1477.pl index ce9b308610..0973c9c951 100755 --- a/tests/test1477.pl +++ b/tests/test1477.pl @@ -78,7 +78,7 @@ sub scanmanpage { close(H); } -opendir(my $dh, $curlh) || die "Cannot opendir $curlh: $!"; +opendir(my $dh, $curlh) or die "Cannot opendir $curlh: $!"; my @hfiles = grep { /\.h$/ } readdir($dh); closedir $dh; diff --git a/tests/test1707.pl b/tests/test1707.pl index 14964a1c00..a19940d141 100755 --- a/tests/test1707.pl +++ b/tests/test1707.pl @@ -44,7 +44,7 @@ else { } # first run the help command -my @curlout; open(O, '-|', $curl, '-h', $opt) || die; push @curlout, ; close(O); +my @curlout; open(O, '-|', $curl, '-h', $opt) or die; push @curlout, ; close(O); # figure out the short+long option combo using -h all*/ open(C, '-|', $curl, '-h', 'all'); diff --git a/tests/test745.pl b/tests/test745.pl index ee2f563ce9..2e46dd938d 100755 --- a/tests/test745.pl +++ b/tests/test745.pl @@ -33,7 +33,7 @@ my %typecheck; # from the include file my %enum; # from libcurl-errors.3 sub gettypecheck { - open(my $f, "<", "$root/include/curl/typecheck-gcc.h") || die "no typecheck file"; + open(my $f, "<", "$root/include/curl/typecheck-gcc.h") or die "no typecheck file"; while(<$f>) { chomp; if($_ =~ /\(option\) == (CURL[^ \)]*)/) { @@ -45,7 +45,7 @@ sub gettypecheck { sub getinclude { my $f; - open($f, "<", "$root/include/curl/curl.h") || die "no curl.h"; + open($f, "<", "$root/include/curl/curl.h") or die "no curl.h"; while(<$f>) { if($_ =~ /\((CURLOPT[^,]*), (CURLOPTTYPE_[^,]*)/) { my ($opt, $type) = ($1, $2); @@ -60,7 +60,7 @@ sub getinclude { $enum{"CURLOPT_CONV_TO_NETWORK_FUNCTION"}++; close($f); - open($f, "<", "$root/include/curl/multi.h") || die "no curl.h"; + open($f, "<", "$root/include/curl/multi.h") or die "no curl.h"; while(<$f>) { if($_ =~ /\((CURLMOPT[^,]*), (CURLOPTTYPE_[^,]*)/) { my ($opt, $type) = ($1, $2); diff --git a/tests/test971.pl b/tests/test971.pl index 1c6ecf893e..221f78bf9b 100755 --- a/tests/test971.pl +++ b/tests/test971.pl @@ -45,7 +45,7 @@ my $error = 0; sub cmdfiles { my ($dir) = @_; - opendir(my $dh, $dir) || die "Cannot opendir $dir: $!"; + opendir(my $dh, $dir) or die "Cannot opendir $dir: $!"; my @opts = grep { /[a-z0-9].*\.md$/ && -f "$dir/$_" } readdir($dh); closedir $dh; -- 2.47.3