}
# pod2usage(join("\n",@USAGE_ERRORS)) if @USAGE_ERRORS;
-print STDERR join("\n",@USAGE_ERRORS) and exit 1 if @USAGE_ERRORS;
+if (@USAGE_ERRORS) {
+ print STDERR map {"$_\n"} @USAGE_ERRORS;
+ exit 1;
+}
# OK. Generate the options to qsub which we'll be using
my @qsub_options = generate_qsub_options(\%options,\@ARGV);
if ($options->{name}) {
push @qo,'-N',$options->{name};
} else {
- push @qo,'-N',join('_',@{$args}[0..min($#{$args},2)]);
+ push @qo,'-N',join('_',
+ map {s/[^a-zA-Z0-9]*//g; $_;}
+ @{$args}[0..min($#{$args},2)]);
}
# join error and output streams
if ($options->{join}) {