RE: Help with file redirect

2011-07-05 Thread Jan Dubois
On Tue, 05 Jul 2011, Barry Brevik wrote:
> 
> I am writing an app that has a lot of screen output which it writes to
> STDERR.
> 
> The screen output is copious, but I need it right now for debugging; I
> can get rid of it later.
> 
> My question is if it is possible to write to STDERR and a named file at
> the same time? I'd rather not go through the code and change every print
> statement.

You could use the `tee` command on the commandline.  A pure Perl
implementation is here:

http://search.cpan.org/~dagolden/Tee-0.14/lib/Tee.pm

Or you multiplex the handle at the Perl level with a PerlIO::tee layer:

http://search.cpan.org/~gfuji/PerlIO-Util-0.72/lib/PerlIO/tee.pm

Cheers,
-Jan


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Help with file redirect

2011-07-05 Thread Arms, Mike
http://search.cpan.org/~kenshan/IO-Tee-0.64/Tee.pm

Think you can use this module to do exactly what you want.

- Mike Arms


-Original Message-
From: perl-win32-users-boun...@listserv.activestate.com 
[mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Barry 
Brevik
Sent: Tuesday, July 05, 2011 2:43 PM
To: perl-win32-users@listserv.ActiveState.com
Subject: Help with file redirect

I am writing an app that has a lot of screen output which it writes to
STDERR.

The screen output is copious, but I need it right now for debugging; I
can get rid of it later.

My question is if it is possible to write to STDERR and a named file at
the same time? I'd rather not go through the code and change every print
statement.

Barry Brevik
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Help with file redirect

2011-07-05 Thread will trillich
I haven't tested this, but here's a similar problem to yours--maybe these
solutions will work for you:

http://www.perlmonks.org/?node_id=4913


On Tue, Jul 5, 2011 at 3:43 PM, Barry Brevik wrote:

> I am writing an app that has a lot of screen output which it writes to
> STDERR.
>
> The screen output is copious, but I need it right now for debugging; I
> can get rid of it later.
>
> My question is if it is possible to write to STDERR and a named file at
> the same time? I'd rather not go through the code and change every print
> statement.
>
> Barry Brevik
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>



-- 
"The Fed is still under the assumption all they have to do to revive an
economy is blow a new bubble" -- Josh Rosner. Amen!
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Help with file redirect

2011-07-05 Thread Barry Brevik
I am writing an app that has a lot of screen output which it writes to
STDERR.

The screen output is copious, but I need it right now for debugging; I
can get rid of it later.

My question is if it is possible to write to STDERR and a named file at
the same time? I'd rather not go through the code and change every print
statement.

Barry Brevik
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs