Acme::MathProfessor::RandomPrime - Pick a random prime number


Acme-MathProfessor-RandomPrime documentation Contained in the Acme-MathProfessor-RandomPrime distribution.

Index


Code Index:

NAME

Top

Acme::MathProfessor::RandomPrime - Pick a random prime number

SYNOPSIS

Top

 use Acme::MathProfessor::RandomPrime;

 say 'Let $N be a random prime'; $N = random_prime;

DESCRIPTION

Top

Math professors often pick a random prime to work out an example. This module mimics the algorithm the typical math professor uses. This allows you to be a math professor!

REFERENCES

Top

DEVELOPMENT

Top

The current sources of this module are found on github, git://github.com/Abigail/Acme--MathProfessor--RandomPrime.git.

AUTHOR

Top

Abigail, mailto:cpan@abigail.be.

COPYRIGHT and LICENSE

Top

INSTALLATION

Top

To install this module, run, after unpacking the tar-ball, the following commands:

   perl Makefile.PL
   make
   make test
   make install


Acme-MathProfessor-RandomPrime documentation Contained in the Acme-MathProfessor-RandomPrime distribution.

package Acme::MathProfessor::RandomPrime;

use 5.006;
use strict;
use warnings;
no  warnings 'syntax';

use Exporter ();

our $VERSION = '2009121001';
our @ISA     = qw [Exporter];
our @EXPORT  = qw [random_prime];

sub random_prime {rand () < .75 ? 17 : 23}


1;

__END__