[revml] [PATCH] VCP::Logger and STDOUT.
Barrie Slaymaker
barries@slaysys.com
Wed, 8 Sep 2004 10:38:43 -0400
On Wed, Sep 08, 2004 at 02:19:07PM +0100, Chia-liang Kao wrote:
> On Wed, Sep 08, 2004 at 05:59:56AM -0400, Barrie Slaymaker wrote:
> > Applied, thanks.
>
> It seems this change makes PPerl unhappy and shows some strange message.
That change here dies with "Unknown error" unless I comment out
my $saver = new SelectSaver( LOG );
here (perl 5.8.2):
C:\Perforce\VCP>perl -Ilib -MVCP::Logger -e1
Unknown error
Compilation failed in require.
BEGIN failed--compilation aborted.
I'm hesitant to require only the very latest Perl, so I'm not sure what
to do. Ideas?
- Barrie
> Please use the one instead.
>
> Cheers,
> CLK
> --- lib/VCP/Logger.pm (revision 1069)
> +++ lib/VCP/Logger.pm (local)
> @@ -344,9 +344,11 @@ BEGIN {
> ## Flush the LOG every print() so that we never miss data and
> ## so that we can pass the log to child processes to emit STDOUT
> ## and STDERR to.
> - *OLDFH = select LOG;
> - $| = 1;
> - select OLDFH;
> + {
> + require SelectSaver;
> + my $saver = new SelectSaver (LOG);
> + $| = 1;
> + }
>
> ## Print a header line guaranteed to start at the beginning of a
> ## line.