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.