From: Stefano Lattarini Date: Wed, 7 Sep 2011 15:41:40 +0000 (+0200) Subject: tap/perl: be more portable to older perl versions X-Git-Tag: ng-0.5a~89^2~70^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55bada2cf9fb9481fbf24f3205fefe6499433c38;p=thirdparty%2Fautomake.git 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. --- diff --git a/ChangeLog b/ChangeLog index 675e58024..a3777fe32 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2011-09-07 Stefano Lattarini + + 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 tap/perl: be more portable to older TAP::Parser versions diff --git a/lib/tap-driver.pl b/lib/tap-driver.pl index dac9f3c59..b6566ad3d 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";