]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
perl: `|| die` -> `or die` master
authorViktor Szakats <commit@vsz.me>
Sun, 14 Jun 2026 23:26:04 +0000 (01:26 +0200)
committerViktor Szakats <commit@vsz.me>
Mon, 15 Jun 2026 22:41:29 +0000 (00:41 +0200)
Usage was fifty-fifty between these syntaxes before this patch.

Closes #22036

29 files changed:
.github/scripts/cleancmd.pl
docs/examples/version-check.pl
scripts/cdall
scripts/checksrc-all.pl
scripts/checksrc.pl
scripts/completion.pl
scripts/extract-unit-protos
scripts/managen
scripts/singleuse.pl
tests/certs/genserv.pl
tests/getpart.pm
tests/libtest/test1013.pl
tests/libtest/test1022.pl
tests/libtest/test610.pl
tests/libtest/test613.pl
tests/runner.pm
tests/runtests.pl
tests/secureserver.pl
tests/servers.pm
tests/sshserver.pl
tests/test1119.pl
tests/test1135.pl
tests/test1165.pl
tests/test1167.pl
tests/test1222.pl
tests/test1477.pl
tests/test1707.pl
tests/test745.pl
tests/test971.pl

index 988d4562046a26730d5572af05c4ac3183ea88f1..d6ddeb7274f431f50b8166e9e871910c20c04b07 100755 (executable)
@@ -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(<S>) {
     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(<O>) {
     chomp;
     if(/^([^ ]+)/) {
@@ -50,7 +50,7 @@ while(<O>) {
 close(O);
 
 open(C, "<./.github/scripts/spellcheck.curl")
-    || die "cannot find spellcheck.curl";
+    or die "cannot find spellcheck.curl";
 while(<C>) {
     if(/^\#/) {
         next;
index a80f3ae632c2ef702eaa5644daf4a11b3f3b4b49..125c3b5f7eb294b9d5b9cbea229ccf0c627e4c93 100755 (executable)
@@ -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(<C>) {
     if(/\W(CURL[_A-Z0-9v]+)\W/) {
index 15111a5c42313a493f96cd0e04c751d2b29d370a..53e6e3692984dc9b97057355c7d0b52396eed68a 100755 (executable)
@@ -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;
 
index 5982384fe115725f57b220fbc1201d30d9db7ff2..fd80c1b4277a5f79ccb99add4ba080c06156bd3d 100755 (executable)
@@ -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, <O>; close(O);
+    open(O, '-|', 'git', 'ls-files', '*.[ch]') or die; push @files, <O>; 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, <O>; close(O);
+        open(O, '-|', 'git', 'ls-files', ":(glob)$dir/*.[ch]") or die; push @files, <O>; close(O);
         chomp(@files);
     }
     else {
index 2f2c218feac605968ad39a7a29440eed6f3eccd0..46d02ae3c83af136b4891b5f904e4cb8dc2b73a7 100755 (executable)
@@ -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 = ();
index 27e2f062e7a4b49b12b593998a32fc819dd5b1ca..203f2acfb6f4c15185192a860e3624b0a729a61b 100755 (executable)
@@ -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);
index b9154012f4ffa457d9134b09781f2c91eed2b6e4..79c66057948ded25e9351b6c876f71956425cd1a 100755 (executable)
@@ -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;
index 2da6ec93542993c59934cd1df962dffd362d8c22..d05e8b9386d30aa15bafe7d3efd413edbbe021f3 100755 (executable)
@@ -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(<INC>) {
         if($_ =~ /^#define LIBCURL_VERSION \"([0-9.]*)/) {
             $version = $1;
index a1d2194d4ef984bd36e99bbbf497cffc462c3fc7..fc6cc7f1116cace9fff41199ae56407daea08a4c 100755 (executable)
@@ -182,7 +182,7 @@ sub doublecheck {
     return @also;
 }
 
-open(N, '-|', 'nm', $file) || die;
+open(N, '-|', 'nm', $file) or die;
 
 my %exist;
 my %uses;
index 96e77449aaa00949484d98c10b58d20aa8354808..6e8ceec315eec9c3b5bb2dc197a78dbb44854c64 100755 (executable)
@@ -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); }
index 74c7f6cb2303761b16f469d56128bff294712ba4..fc98da210c0bc716118d812836565a0e33b88400 100644 (file)
@@ -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";
 }
 
 #
index 154c4227a6e31ab3d24854400d3e40bfdbe879f0..b6bd5be7ff0309a04b11e2547fce602c48141905 100755 (executable)
@@ -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>) {
     $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(<CURLCONFIG>) {
     chomp;
     $_ = lc($_) if($what eq "protocols");  # accept uppercase protocols in curl-config
index 49e295433b7e4f49ed3ac6b67811ea7d6884b3e7..a74a180e1d04ae63df4fa32dc02859562e2a6006 100755 (executable)
@@ -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";
 $_ = <CURL>;
 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";
 $_ = <CURLCONFIG>;
 chomp;
 my $filever = $_;
index 10f665620ae2e3161377bb722453b0c685a67f76..af63c3e6b3b6e818ebb748b76a08c1b0d5fee2aa 100755 (executable)
@@ -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;
index bec12b9c5a13f11bd59b8f192f5178e291b58600..314f3829ac93182bb31615f090dc18c7866b65f6 100755 (executable)
@@ -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(<IN>) {
             /^(.)(..).(..).(..).\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);
 
index 6fa68670e9651e31ccb04e2bcb87332e0f1c2a67..fd665b94842469af3b74e5eaa03bc54ff2ac3a3b 100644 (file)
@@ -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
index 32695e2a52d31eb312d2e6478598e6930374e711..f660fa6e262cb06453ad94195042e558d97c269a 100755 (executable)
@@ -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);
 
index d0da33e352b83f15943bdcd8e431129a960df96b..5025d47b4b8bb1c97fdbeb85a0ae348ffe0929d0 100755 (executable)
@@ -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.
 
index 454931aeb05e2db0ec73453a587c0894fb09684d..474a12c377e753f6d11251bdd90389972e71cd8b 100644 (file)
@@ -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 {
index 743f6356ded7bd88f951bbb9e96b738bf951d831..2461b668b11420232b56a5f9041cf61392869698 100755 (executable)
@@ -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.
 
index 4797c758bd9b3501bf099343da508b7993d0b79c..75bca88a67d20d6bd91feae6631f85b22cfe4212 100755 (executable)
@@ -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 {
index 152adef463769986d0dccfb4fa534067b0d74710..907a08d20bb203891b33ddd8245187863adc1234 100755 (executable)
@@ -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(<H>) {
         s/CURL_DEPRECATED\(.*"\)//;
index e3f45b2ada21a6b35151ac4b06756a6fb8987c61..ef6b34f3285604b84683500d3d1dcb76136c2873 100755 (executable)
@@ -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) {
index eea5fe45f1caa46a22e9ff244d6c438eb2955451..06b2b2b6cd69a1f19bbc622506c014876569e847 100755 (executable)
@@ -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;
 
index d34fb7bca45361ece56ce27df7fa9612c1a5407b..a601688ee6053ffb9741888e81dc5e32ff0d30d3 100755 (executable)
@@ -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;
 
index ce9b3086101dec2436789df4cccf8066bf0de708..0973c9c95135ff246595f122cc2bfd25b6121d5f 100755 (executable)
@@ -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;
 
index 14964a1c00d7626458534a08f2fd91e0c7dc9a71..a19940d141f1b7e2e721c03aaeebc8006aabd144 100755 (executable)
@@ -44,7 +44,7 @@ else {
 }
 
 # first run the help command
-my @curlout; open(O, '-|', $curl, '-h', $opt) || die; push @curlout, <O>; close(O);
+my @curlout; open(O, '-|', $curl, '-h', $opt) or die; push @curlout, <O>; close(O);
 
 # figure out the short+long option combo using -h all*/
 open(C, '-|', $curl, '-h', 'all');
index ee2f563ce91388e84a1809b32cdcb7db27fd45db..2e46dd938d2d5b1f860626e91b33bf61dbf82713 100755 (executable)
@@ -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);
index 1c6ecf893e54466804d18db3ac952db4077af85d..221f78bf9b7a53b6ca5e4a3af3cb209300c3b8b0 100755 (executable)
@@ -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;