Test::Simple automates
the boring task of writing "ok 1",
"ok 2", "ok
3", and so on, in your program.
Test::Simple exports one subroutine, called
(appropriately) ok. It's best
illustrated by example. For the earlier code, you can rewrite it as:
use Test::Simple tests => 4;
ok(1 + 2 == 3, '1 + 2 == 3');
ok(2 * 4 == 8, '2 * 4 == 8');
my $divide = 5 / 3;
ok(abs($divide - 1.666667) < 0.001, '5 / 3 == (approx) 1.666667');
my $subtract = -3 + 3;
ok(($subtract eq "0" or $subtract eq "-0"), '-3 + 3 == 0');