This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Avoid ++ in test.pl
authorDagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Thu, 15 Jun 2017 15:14:06 +0000 (16:14 +0100)
committerDagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Thu, 15 Jun 2017 15:15:45 +0000 (16:15 +0100)
The header comment warns to keep it simple, and specifically against
++ due to its cleverness for string magic auto-increment, but a couple
of places had missed the memo.

t/test.pl

index d86f633..79e6e25 100644 (file)
--- a/t/test.pl
+++ b/t/test.pl
@@ -860,7 +860,7 @@ sub unlink_all {
        if( -f $file ){
            _print_stderr "# Couldn't unlink '$file': $!\n";
        }else{
-           ++$count;
+           $count = $count + 1; # don't use ++
        }
     }
     $count;
@@ -1141,7 +1141,7 @@ sub setup_multiple_progs {
         my $found;
         while (<$fh>) {
             if (/^__END__/) {
-                ++$found;
+                $found = $found + 1; # don't use ++
                 last;
             }
         }