in reply to logging and cron jobs

Hi infiniteloop,

If you want to avoid STDERR word when ever you want redirect error to error file, you can tie a filehandle to a module where you can define print function.

untie *STDOUT; $log = tie(*STDOUT, 'module_name', "logfile_name") Inside the module sub print { my ($class, @data) = @_; print $class->{handle} = @data; . . .

If you want to redirect both STDOUT and STDERR to file, please redirect these to a file.You can set the log file in runtime also.

open STDOUT, ">>$logfile"; open STDERR, ">&STDOUT";

Tie this STDOUT to the module where you have implemented this print function.

I think this resloves your issues.
-Prasanna.K