Help for this page

Select Code to Download


  1. or download this
    $i = 0;
    where 12 is the size of my array. and i is an index, or is there an al
    +ternative?
    ...
             print "yes it's a month\n";
    }
    }
    
  2. or download this
    for $i (0..$#array) { # just in case they change the number of months 
    +:)
      next unless ($month eq $array[$i]); # skip if not equal
      print "Yes its a month\n";
      last; # no need to check other months so exit loop
    }