Subject: | [PATCH] Trace.pm: autoflush stdout |
Date: | Wed, 25 Oct 2006 12:56:32 +0400 |
To: | bug-devel-trace [...] rt.cpan.org |
From: | Alexey Tourbin <at [...] altlinux.ru> |
The trace is printed to STDERR. When used with pager, STDOUT is buffered
and falls behind STDERR. The quick fix is to set $|, which is what I propose.
(The better fix would be to set line-buffered mode, to avoid mixing the lines.)
---
Trace.pm | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/Trace.pm b/Trace.pm
index 7b758a6..66c6743 100644
--- a/Trace.pm
+++ b/Trace.pm
@@ -31,6 +31,7 @@ sub trace {
my $arg = shift;
$arg = $tracearg{$arg} while exists $tracearg{$arg};
$TRACE = $arg;
+ $| = 1 if $TRACE;
}
1;
--
1.4.3.GIT