Help for this page

Select Code to Download


  1. or download this
    for (0..$all_the_numbers)
    {
      ... # This will be called $all_the_numbers+1 times 
          # (eg, if $all_the_numbers is 1, it will be called for 0 and 1, 
    +so twice)
    }
    
  2. or download this
    for (0..$all_the_numbers)
    {
       my $number = 30 - int(rand(20));
    ...
       next if $number >= 0; # Skip if number is positive
       push @negative_only;
    }
    
  3. or download this
    for my $random_number (@all_rand)
    {
      push @negative_only if $random_number < 0;
    }