Search⌘ K
AI Features

Packages

Learn to work with Perl packages and namespaces, understanding their role in organizing code and managing global variables and functions. Discover how package versions and fully qualified names help maintain scalable and clear Perl code, enhancing maintainability and reducing namespace conflicts.

Packages

A Perl namespace associates and encapsulates various named entities. It’s like our family name or a brand name. Unlike a real-world name, a namespace implies no direct relationship between entities. Such relationships may exist, but they’re not required to.

A package in Perl is a collection of code in a single namespace. The distinction is subtle: the package represents the source code, and the namespace represents the internal data structure Perl uses to ...