Date sent: Mon, 22 Jun 2009 10:53:06 -0700
From: pa...@compugenic.com
To: beginners@perl.org
Subject:redirecting STDERR with IO::Tee
> I have a script which runs mostly via a cron job and sometimes
> interactively. I woul
On Wed, Jun 24, 2009 at 05:52:36PM +0800, Jeff Pang wrote:
> 2009/6/23 :
> > I have a script which runs mostly via a cron job and sometimes
> > interactively. I would like STDERR to automatically print to both the
> > console and to a logfile simultaneously.
>
> Hi,
>
> What causes writting
2009/6/23 :
> I have a script which runs mostly via a cron job and sometimes interactively.
> I would like STDERR to automatically print to both the console and to a
> logfile simultaneously.
>
> Right now I've gotten as far as merging both file handles with IO::Tee but
> I'm not sure if I'm h
I have a script which runs mostly via a cron job and sometimes interactively.
I would like STDERR to automatically print to both the console and to a logfile
simultaneously.
Right now I've gotten as far as merging both file handles with IO::Tee but I'm
not sure if I'm heading down the right p
e "Failed to restore STDERR";
>
>
> -Original Message-
> From: Ryan Frantz [mailto:[EMAIL PROTECTED]
> Sent: Friday, October 07, 2005 12:10 PM
> To: beginners@perl.org
> Subject: Redirecting STDERR
>
> Perlers,
>
> I have a script where I redirec
quot;Failed to restore STDERR";
>
>
> -----Original Message-
> From: Ryan Frantz [mailto:[EMAIL PROTECTED]
> Sent: Friday, October 07, 2005 12:10 PM
> To: beginners@perl.org
> Subject: Redirecting STDERR
>
> Perlers,
>
> I have a script where I redirect STDE
From: Ryan Frantz [mailto:[EMAIL PROTECTED]
Sent: Friday, October 07, 2005 12:10 PM
To: beginners@perl.org
Subject: Redirecting STDERR
Perlers,
I have a script where I redirect STDERR to a file so that I can capture
'die' messages like so:
use warnings;
use strict;
my $logfile
Perlers,
I have a script where I redirect STDERR to a file so that I can capture
'die' messages like so:
use warnings;
use strict;
my $logfile = "/some/path/logfile.txt";
open STDERR, ">>$logfile";
something or die "Unable to do something()\n";
close STDERR;
Is it kosher to do this? Or is t
Hello,
I am using the following to redirect STDERR and STDOUT:
open(STDOUT, "> $logfile") || die "Can't redirect stdout";
open(STDERR, ">&STDOUT") || die "Can't dup stdout";
select(STDERR); $| = 1; # make unbuffered
select(STDOUT); $| = 1; # make unbuffered
..
close(STDOUT
Try the Module IO::Tee, I haven't used it, but it's description sounds to be
what you need
> -Original Message-
> From: Peter Scott [mailto:[EMAIL PROTECTED]]
> Sent: 13 November 2001 07:01
> To: [EMAIL PROTECTED]
> Subject: Re: Redirecting STDERR to 2
>I have been trying to figure out if it possible to redirect STDERR to 2
>locations at once. Specifically, I want certain errors to be redirected
>to both STDOUT and a log file. I have been unable to do this, and am not
>even sure it is possible.
>
>Redirecting to one or the other is now pro
At 05:24 PM 11/12/01 -0500, you wrote:
>>I have been trying to figure out if it possible to redirect STDERR to 2
>>locations at once. Specifically, I want certain errors to be redirected
>>to both STDOUT and a log file. I have been unable to do this, and am not
>>even sure it is possible.
>>
>I have been trying to figure out if it possible to redirect STDERR to 2
>locations at once. Specifically, I want certain errors to be redirected
>to both STDOUT and a log file. I have been unable to do this, and am not
>even sure it is possible.
>
>Redirecting to one or the other is now pro
13 matches
Mail list logo