you probably want to save STDERR before redirect it to STDOUT so that later 
you can change it back:

open(OLD_ERR,">&STDERR");
open(STDOUT,">$log_full_name");
open(STDERR,">&STDOUT");

#-- code

#-- restore STDERR
open(STDERR,">&OLD_ERR");

other than that. your code seems to be ok.

david

Nyimi Jose wrote:

> I need to redirect STDOUT and SDTERR to a predefined logfile.
> 
> I wrote this so far:
> 
> $log_full_name and open (STDOUT,">$log_full_name") or warn "can not
> redirect STDOUT to $log_full_name : $!\n"); open (STDERR,">&STDOUT") or
> warn "can not redirect STDERR : $!\n");
> 
> May I ask to review this code and suggest an another way to it, please ?
> 
> TMTWOTDI,
> 
> Thanks in advance for your help.
> 
> José.
> 
> 
> **** DISCLAIMER ****
> 
> "This e-mail and any attachment thereto may contain information which is
> confidential and/or protected by intellectual property rights and are
> intended for the sole use of the recipient(s) named above. Any use of the
> information contained herein (including, but not limited to, total or
> partial reproduction, communication or distribution in any form) by other
> persons than the designated recipient(s) is prohibited. If you have
> received this e-mail in error, please notify the sender either by
> telephone or by e-mail and delete the material from any computer".
> 
> Thank you for your cooperation.
> 
> For further information about Proximus mobile phone services please see
> our website at http://www.proximus.be or refer to any Proximus agent.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to