Re: STDOUT and STDERR to same file

2006-08-29 Thread Jeff Pang
sub log_warn { my $time=scalar localtime; open (HDW,">>",$err_log); print HDW $time," ",@_; close HDW; } Hope this helps. -Original Message- >From: Ken Foskey <[EMAIL PROTECTED]> >Sent: Aug 29, 2006 10:06 AM >To: Beginners L

Re: STDOUT and STDERR to same file

2006-08-29 Thread Muttley Meen
On 8/29/06, Ken Foskey <[EMAIL PROTECTED]> wrote: I have a daemon process that works but I am currently running it with script.pl > error.log 2>&1 and I want to do the same thing without using the redirection,, remove the human error when starting the program. I can `open( STDERR, '>', 'error

Re: STDOUT and STDERR to same file

2006-08-29 Thread Mumia W.
On 08/29/2006 09:06 AM, Ken Foskey wrote: I have a daemon process that works but I am currently running it with script.pl > error.log 2>&1 and I want to do the same thing without using the redirection,, remove the human error when starting the program. I can `open( STDERR, '>', 'error.log') .

Re: STDOUT and STDERR to same file

2006-08-29 Thread Tom Phoenix
On 8/29/06, Ken Foskey <[EMAIL PROTECTED]> wrote: I can `open( STDERR, '>', 'error.log') ...` but is there a piece of magic to duplicate that to STDOUT as well (ie same file output) open(STDERR, '>', 'error.log') or die "Can't redirect stderr: $!"; open(STDOUT, ">&STDERR") or die "Can't

STDOUT and STDERR to same file

2006-08-29 Thread Ken Foskey
I have a daemon process that works but I am currently running it with script.pl > error.log 2>&1 and I want to do the same thing without using the redirection,, remove the human error when starting the program. I can `open( STDERR, '>', 'error.log') ...` but is there a piece of magic to duplica