http://www.perlmonks.org?node_id=159196


in reply to Source files, packages and name spaces

My standard idiom for including multiple packages in the same file is:
BEGIN { package My::Package; ... code goes here ... }
That way, it acts like a use, causing all "regional" definitions and actions to be executed before the "main" program starts running.

-- Randal L. Schwartz, Perl hacker