close(STDERR); open(STDERR,">mylogfile.log"); print STDERR 'this goes to my log file now';