Paul.G wrote:
Below is an extract from the perl script, the switch/case statement seemed like 
a simple solution.



##################### Mail Program #####################################

operation_CHECKFREEPVS();
print "$numPV \n";
# print "$FreePV[1] $FreePV[0] $numPV\n";
if ($numPV ne 0 ) {
    switch ($numPV) {
           case 1 { print "$FreePV[0] \n"; }
           case 2 { print "$FreePV[0] $FreePV[1] \n"; }
           case 3 { print "$FreePV[0] $FreePV[1] $FreePV[2] \n"; }
    }
  }

Couldn't you just do that like this:

if ( @FreePV && @FreePV <= 3 ) {
    print join( ' ', @FreePV ), "\n";
    }


  else {
    print "No PV's available \n";
  }



John
--
Any intelligent fool can make things bigger and
more complex... It takes a touch of genius -
and a lot of courage to move in the opposite
direction.                   -- Albert Einstein

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to