open(STDERR, '>', '/path/to/logfile') or die "Can't open STDERR to /path/to/logfile: $!\n";