This example builds a prime number test, tests it, and runs some checks against command line arguments.
It should be split into 3 files denoted by BEGIN ... END here in a real-life application:
lib/My/Prime.pm - a module exporting is_prime check by default;
t/my-prime.t - a unit test that tests the test;
It actually caught a bug in my prime definition on first run of this script!
bin/test-primes.pl - a binary that works on input.
To install Assert::Refute, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Assert::Refute
CPAN shell
perl -MCPAN -e shell install Assert::Refute
For more information on module installation, please visit the detailed CPAN module installation guide.