0

I'm attempting to debug a HPC cluster.

One problem: submitting Perl scripts into a several hundred node Linux Suse cluster via Open Grid Scheduler (OGS/GE 2011.11).

This generates a runtime error for Perl scripts on the "long queue" in the cluster, but not on the "short queue".

$> qsub -cwd -q short.q ./test.pl

Output is ok

$> qsub -cwd -q long.q ./test.pl

Output error log, /var/spool/sge/comp26/job_scripts/3141815: line 2: syntax error near unexpected token my' /var/spool/sge/comp26/job_scripts/3141815: line 2:open (my $fh, '>', 'test.out');'

If I submit a shell script to the long queue it works, containing

perl ./test.pl 

Any ideas?

System: GNU bash, version 4.2.46(2), Perl v5.16.3 (yuk)

Test script

#!/usr/bin/perl
# Also tried #!/bin/perl
system("perl -v > perl.out");
open (my $fh, '>', 'test.out');
print $fh 'test';
close $fh;
M__
  • 614
  • 2
  • 10
  • 25
  • 1
    That error message comes from the shell, not perl, so for whatever reason the script isn't being seen as a perl script – Dave Mitchell Dec 12 '18 at 18:06
  • Thanks, I've asked it "which perl", but beyond that I'm stuck. – M__ Dec 12 '18 at 18:37
  • 1
    the recommended shebang is `#!/usr/bin/env perl` - see https://stackoverflow.com/questions/2791954/what-should-i-use-for-a-perl-scripts-shebang-line Have you tried setting the exact path to your perl binary instead? – bytepusher Dec 12 '18 at 20:47

1 Answers1

0

The solution,as @bytepusher described, was

#!/usr/bin/env perl

and submission to qsub -cwd -q long.q ./test.pl was fine.

M__
  • 614
  • 2
  • 10
  • 25