Pragmas
Many programming languages allow you to give hints to the compiler. In
Perl, these hints are conveyed to the compiler with the use
declaration. Some pragmas are:
use warnings; use strict; use integer; use bytes; use constant pi => ( 4 * atan2(1,1) );
Perl pragmas are all described in Chapter 29, but right now we’ll just talk specifically about a couple that are most useful with the material covered in this chapter.
Although a few pragmas are global declarations that affect
global variables or the current package, most are lexically scoped
declarations whose effects are constrained to last only until the end
of the enclosing block, file, or eval (whichever comes first). A lexically
scoped pragma can be countermanded in an inner scope with a no declaration, which works just like
use but in reverse.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access