in reply to Modules containing test code in the same file
package Foo; ... return 1 if caller; package main; my $test = Foo->new(...); ... [download]