Pragmas
Learn about pragmas, how they behave in scopes, and how to use them.
We'll cover the following...
We'll cover the following...
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.
We’ve seen how declaring a lexical variable makes a symbol name available within a scope. Using a pragma makes its behavior effective within a scope as well:
Just as lexical declarations affect inner scopes, pragmas maintain their effects within inner scopes: