#!/usr/bin/perl use mymodules::foo; # Remove this line # main program here exit; # copy your modules into BEGIN blocks # be prepared to tweak & debug BEGIN{ package mymodules::foo; sub new { ... } sub bar { ... } etc ... }