[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[FYI] {test-protocols} tap/perl: be more portable to older perl versions
From: |
Stefano Lattarini |
Subject: |
[FYI] {test-protocols} tap/perl: be more portable to older perl versions |
Date: |
Wed, 7 Sep 2011 19:51:12 +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 | 9 +++++++++
lib/tap-driver.pl | 3 ++-
2 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 675e580..a3777fe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2011-09-07 Stefano Lattarini <address@hidden>
+ 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 <address@hidden>
+
tap/perl: be more portable to older TAP::Parser versions
* lib/tap-driver.pl (start): Do not call the `ignore_exit' method
on our TAP parser: it is not supported in older TAP::Parser
diff --git a/lib/tap-driver.pl b/lib/tap-driver.pl
index dac9f3c..b6566ad 100755
--- a/lib/tap-driver.pl
+++ b/lib/tap-driver.pl
@@ -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";
--
1.7.2.3
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [FYI] {test-protocols} tap/perl: be more portable to older perl versions,
Stefano Lattarini <=