# File modulino.pl package My::Modulino; use strict; use warnings; __PACKAGE__->main() unless caller(); sub foo { # utility subroutine return "foo"; } sub main { # body of the script } 1; # require needs to be true #### use Test::More tests => 2; require_ok( "modulino.pl" ); is( My::Modulino::foo(), "foo", "got foo" );