]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tap/perl: be more portable to older perl versions
authorStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 7 Sep 2011 15:41:40 +0000 (17:41 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 7 Sep 2011 15:41:40 +0000 (17:41 +0200)
* lib/tap-driver.pl (trap_perl_warnings_and_errors): Do not use
the three-args version of the `open' builtin, it is not well
supported by older perl versions (at least perl 5.6.2).
(start): Add a no-op statement to pacify a "possible typo ... used
only once" perl warning.

ChangeLog
lib/tap-driver.pl

index 675e580242310c29330554fb1f9f01ecf024fe28..a3777fe321898df9e8c9bd3cf3698546f5782f3b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-09-07  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       tap/perl: be more portable to older perl versions
+       * lib/tap-driver.pl (trap_perl_warnings_and_errors): Do not use
+       the three-args version of the `open' builtin, it is not well
+       supported by older perl versions (at least perl 5.6.2).
+       (start): Add a no-op statement to pacify a "possible typo ... used
+       only once" perl warning.
+
 2011-09-07  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        tap/perl: be more portable to older TAP::Parser versions
index dac9f3c59faa9dec93f81795cfdba13387b0c211..b6566ad3ddeb47c9d7b94b7ce02b6fbd7414f084 100755 (executable)
@@ -239,7 +239,7 @@ sub trap_perl_warnings_and_errors ()
     {
       # Be sure to send the warning/error message to the original stderr
       # (presumably the console), not into the log file.
-      open STDERR, ">&", \*OLDERR;
+      open STDERR, ">&OLDERR";
       die @_;
     }
 }
@@ -253,6 +253,7 @@ sub start (@)
   open LOG, ">", $log_file or die "$ME: opening $log_file: $!\n";
   open OLDOUT, ">&STDOUT" or die "$ME: duplicating stdout: $!\n";
   open OLDERR, ">&STDERR" or die "$ME: duplicating stdout: $!\n";
+  *OLDERR = *OLDERR; # To pacify a "used only once" warning.
   trap_perl_warnings_and_errors;
   open STDOUT, ">&LOG" or die "$ME: redirecting stdout: $!\n";
   open STDERR, ">&LOG" or die "$ME: redirecting stderr: $!\n";