- $log->info("Creating MARC export file $path", $self->{lint} ? ' (with lint)' : '', " encoding ", $self->{marc_encoding}, "\n");
- if ( $ENV{MARCXML} ) {
- open($self->{fh_marcxml}, '>:utf8', "$path.marcxml");
+ $log->info("Creating MARC export file $path.marc", $self->{lint} ? ' (with lint)' : '', " encoding ", $self->{marc_encoding}, "\n");
+ if ( $self->{marcxml} || $ENV{MARCXML} ) {
+ open($self->{fh_marcxml}, '>:utf8', "$path.marcxml") ||
+ $log->logdie("can't open MARCXML output $path.marcxml: $!");
+ $log->info("Creating MARCXML export file $path.marcxml");