You can structure your code so that it uses more than one file. See use and require (and do, but you'll probably find use and require enough). Separating your code into logical units is actually a good practice when programming in just about any language.
If that's not enough information for you (and it probably won't be enough), move on to perlmod and perlmodlib; then, last (but not least) try the CPAN for many examples.