Subject: | LSF (v0.9) Queue Bug when running with RaiseError = 0 : ERROR: Use of uninitialized value $output[0] in split at .../perl5/LSF/Queue.pm line 23. |
Date: | Thu, 2 Oct 2014 10:42:20 -0700 |
To: | "bug-LSF [...] rt.cpan.org" <bug-LSF [...] rt.cpan.org> |
From: | Keith Westgate <westgate [...] cadence.com> |
I was calling LSF::Queue as below with RaiseError turned off. I get the following error:
ERROR: Use of uninitialized value $output[0] in split at /home/westgate/work/dispatch/src/../perl/lib/perl5/LSF/Queue.pm line 23.
that code looks like this :
18 sub new{
19 my($class,@params) = @_;
20 my @output = $class->do_it('bqueues','-l',@params);
21 return unless @output;
22 my @queue;
23 for my $text (split(/^-+$/m,$output[0])){
the problem is the "return unless" at line 21 isn't working. Than because @output is getting set by the do_it call at line 20. I fixed it by changing it to this :
return unless $output[0];
this is from version LSF-0.9.
======= my code ====
use LSF;
sub ValidateQueue {
LSF::Queue->PrintOutput(0);
LSF::Queue->PrintError(0);
LSF::Queue->RaiseError(0);
my $qinfo;
($qinfo) = LSF::Queue->new( $_[0] );
return defined($qinfo);
}
ValidateQueue("no-such-queue");