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


in reply to Re: Re: Confused about splitting program into multiple files.
in thread Confused about splitting program into multiple files.

Well "preferred" doesn't really apply, but if you want to do what you are saying, just put "package main;" at the top of the 'module' instead of some other package name.

Your main program is package main, and by putting your module's subroutines into package main, they are automatically available for you without exporting.

You probably don't want to here this, but I'll reiterate what the docs and other commenters say. You should really do it the right way and segregate things into separate packages and export only symbols that need to be.