#!/usr/bin/perl package Foo; # ... unless (caller) { # ... execute this code if we're run stand-alone } else { # ... do whatever module initialization here. } __END__