sub redirect_elog { my ($file) = @_; local *LCSTDERR; open(LCSTDERR, ">>$file") or die "Can't open log file $file"; open(STDERR, ">&LCSTDERR") or die "can't redirect standard error"; }