package Buttersquash; sub foo { 'bar' } sub bar { 'foo' } package main; unless(caller()){ print "1..3\n"; print "ok 1\n"; print "not " if Buttersquash->foo ne 'bar'; print "ok 2\n"; print "not " if Buttersquash->bar ne 'foo'; print "ok 3\n"; } =head1 SELF CONTAINED TEST If you already installed this, simply run this oneliner # on nix perl -MButtersquash -e' exec $^X, $INC{q[Buttersquash.pm]}' # on windows perl -MButtersquash -e" exec $^X, $INC{q[Buttersquash.pm]}" or simply perl Buttersquash.pm =cut