Help for this page

Select Code to Download


  1. or download this
    sub listprimes {
         my $n      = shift; 
    ...
         
         return $answer;
     }
    
  2. or download this
    for my $element (@primes) {
        if ($element <= $n) {
    ...
            last;
            }
        }
    
  3. or download this
    for my $element (@primes) {
        last if $element > $n;
        $answer .= " $element";
        }
    
  4. or download this
    my @in_range;
    
    ...
        }
    
    return " @in_range";