in reply to STDERR and die

If you want to print the error in some other file then, use $SIG{__DIE__} handler. Inside that handler log the message in the file that you want to store the message.

Replies are listed 'Best First'.
Re^2: STDERR and die
by xiaoyafeng (Deacon) on Jan 16, 2009 at 12:48 UTC
    You can simply use open function like below:
    open (STDERR, ">>err.log") or die "can't redirect STDERR $!\n";
    But you might find something turning your eyes on if you search CPAN before writing this code.


    I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction