B.3. PackagesPackages[] allow you to compartmentalize namespaces. Imagine you have ten programmers all working on one big project. If you use the global names $fred, @barney, %betty, and &wilma in your part of the project, what happens when I accidentally use one of those same names in my part? Packages keep them separate; I can access your $fred, and you can access mine but not by accident. Packages are needed to make Perl scalable, so we can manage large programs. The Alpaca discusses packages in detail.
|