bug-vc-dwim
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-vc-dwim] [PATCH] avoid a warning from perl-5.12


From: Jim Meyering
Subject: [Bug-vc-dwim] [PATCH] avoid a warning from perl-5.12
Date: Fri, 05 Nov 2010 20:22:28 +0100

I've just noticed that with perl-5.12, vc-dwim would generate new warnings,
which look well-deserved.

I've just pushed this fix:

>From dedaa6a63da19c8d867aebbec5b8b75f09cf09c1 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Fri, 5 Nov 2010 20:20:28 +0100
Subject: [PATCH] avoid a warning from perl-5.12

e.g., "main::SAVE_ERR" used only once: ..."
This unexpected output to stderr was making several tests fail.
* vc-dwim.pl (run_command): Use 3-argument form of open,
rather than embedding glob name in a string.
---
 ChangeLog  |    8 ++++++++
 vc-dwim.pl |    6 +++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6717112..8058035 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-11-05  Jim Meyering  <address@hidden>
+
+       avoid a warning from perl-5.12
+       e.g., "main::SAVE_ERR" used only once: ..."
+       This unexpected output to stderr was making several tests fail.
+       * vc-dwim.pl (run_command): Use 3-argument form of open,
+       rather than embedding glob name in a string.
+
 2010-04-17  Jim Meyering  <address@hidden>

        doc: mention the 2009-10-30 bug fix
diff --git a/vc-dwim.pl b/vc-dwim.pl
index 45e5f59..57de653 100755
--- a/vc-dwim.pl
+++ b/vc-dwim.pl
@@ -311,7 +311,7 @@ sub run_command

   if ($options{INHIBIT_STDERR})
     {
-      open SAVE_ERR, ">&STDERR";
+      open SAVE_ERR, '>&', STDERR;
       open STDERR, ">/dev/null"
         or die "$ME: cannot redirect stderr to /dev/null: $!\n";
       select STDERR; $| = 1;
@@ -321,9 +321,9 @@ sub run_command
   my $rc = 0xffff & system @cmd;

   # Restore stdout.
-  open STDOUT, ">&SAVE_OUT"
+  open STDOUT, '>&', SAVE_OUT
     if $options{INHIBIT_STDOUT};
-  open STDERR, ">&SAVE_ERR"
+  open STDERR, '>&', SAVE_ERR
     if $options{INHIBIT_STDERR};

   if ($rc == 0)
--
1.7.3.2.193.g78bbb



reply via email to

[Prev in Thread] Current Thread [Next in Thread]