Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

19 lines (14 sloc) 0.346 kb
#!/usr/bin/env perl
use strict;
use warnings;
use lib 'lib';
use Math::Primality qw/is_prime/;
$|++;
# PODNAME: primes.pl
# ABSTRACT: Print all primes between the two integers
my ($start, $end) = @ARGV;
die "USAGE:$0 start end\n" unless ($start >= 0 && $end > $start);
my $i=$start;
while ( $i++ < $end ){
print "$i\n" if is_prime($i);
}
Jump to Line
Something went wrong with that request. Please try again.