Pragmas

Learn about pragmas, how they behave in scopes, and how to use them.

Most Perl modules provide new functions or define classes. Others, such as strict or warnings, influence the behavior of the language itself. This second type of module is a pragma. By convention, pragma names are written in lowercase to differentiate them from other modules.

Pragmas and scope

Pragmas work by exporting specific behavior or information into the lexical scopes of their callers.

Get hands-on with 1200+ tech skills courses.