my $error_log = "error-$datestamp"; open STDERR, "> $error_log" or warn "Error redirecting stderr to $error_log: $!\n";