home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Book HomeLearning Perl, 3rd EditionSearch this book

B.6. Pragmas

Pragmas are special modules that come with each release of Perl and tell Perl's internal compiler something about your code. You've already used the strict pragma. The pragmas available for your release of Perl should be listed in the perlmodlib manpage.

You use pragmas much like you'd use ordinary modules, with a use directive. Some pragmas are lexically scoped, like lexical ("my") variables are, and they therefore apply to the smallest enclosing block or file. Others may apply to the entire program or to the current package. (If you don't use any packages, the pragmas apply to your entire program.) Pragmas should generally appear near the top of your source code. The documentation for each pragma should tell you how it's scoped.



Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.