#!/usr/bin/perl

if($#ARGV == -1) {
	print "Please include the number on the command line.\n";
} else {
	$n = $ARGV[0];
	for($i = 2; $i < sqrt($n); $i++) {
		if($n % $i == 0) {
			$isprime = 1;
		}
	}
	if($isprime == 0) {
		print "$n is prime\n";
	}
	if($isprime == 1) {
		print "$n is not prime\n";
	}
}
