in reply to how to redirect STDERR and STDOUT to a file when running as a windows service?

redirect your standard output and error by opening the log file , this way :
open ( STDOUT, ">>$logfilename" ) or die "aargh... $!"; open ( STDERR, ">>$errorfilename" ) or die "aargh... $!";
In case you'd rather use only one file, you could do :
open ( STDERR , '>>$logfilename' ) or die "aaaagh... $!"; open ( STDOUT , ">&STDERR" ) or die "aaaagh... $!";

Replies are listed 'Best First'.
Re^2: how to redirect STDERR and STDOUT to a file when running as a windows service?
by toadi (Chaplain) on May 12, 2006 at 13:06 UTC
    Duh I should have known that :) Friday afternoon first sunny week and the brain leaves the building :D


    --
    My opinions may have changed,
    but not the fact that I am right

Re^2: how to redirect STDERR and STDOUT to a file when running as a windows service?
by Anonymous Monk on Nov 02, 2012 at 10:28 UTC
    Thanks, you save my day.