Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
You are viewing the version of this documentation from Perl 5.8.3. View the latest version

CONTENTS

Pragmatic Modules

They work somewhat like compiler directives (pragmata) in that they tend to affect the compilation of your program, and thus will usually work well only when used within a use, or no. Most of these are lexically scoped, so an inner BLOCK may countermand them by saying:

no integer;
no strict 'refs';
no warnings;

which lasts until the end of that BLOCK.

Some pragmas are lexically scoped--typically those that affect the $^H hints variable. Others affect the current package instead, like use vars and use subs, which allow you to predeclare a variables or subroutines within a particular file rather than just a block. Such declarations are effective for the entire file for which they were declared. You cannot rescind them with no vars or no subs.

The following pragmas are defined (and have their own documentation).

  • attributes - Get/set subroutine or variable attributes

  • attrs - Set/get attributes of a subroutine (deprecated)

  • autouse - Postpone load of modules until a function is used

  • base - Establish IS-A relationship with base class at compile time

  • bigint - Transparent BigInteger support for Perl

  • bignum - Transparent BigNumber support for Perl

  • bigrat - Transparent BigNumber/BigRational support for Perl

  • blib - Use MakeMaker's uninstalled version of a package

  • bytes - Force byte semantics rather than character semantics

  • charnames - Define character names for \N{named} string literal escapes

  • constant - Declare constants

  • diagnostics - Produce verbose warning diagnostics

  • encoding - Allows you to write your script in non-ascii or non-utf8

  • fields - Compile-time class fields

  • filetest - Control the filetest permission operators

  • if - use a Perl module if a condition holds

  • integer - Use integer arithmetic instead of floating point

  • less - Request less of something from the compiler

  • lib - Manipulate @INC at compile time

  • locale - Use and avoid POSIX locales for built-in operations

  • open - Set default PerlIO layers for input and output

  • ops - Restrict unsafe operations when compiling

  • overload - Package for overloading perl operations

  • re - Alter regular expression behaviour

  • sigtrap - Enable simple signal handling

  • sort - Control sort() behaviour

  • strict - Restrict unsafe constructs

  • subs - Predeclare sub names

  • threads - Perl extension allowing use of interpreter based threads from perl

  • threads::shared - Perl extension for sharing data structures between threads

  • utf8 - Enable/disable UTF-8 (or UTF-EBCDIC) in source code

  • vars - Predeclare global variable names (obsolete)

  • vmsish - Control VMS-specific language features

  • warnings - Control optional warnings

  • warnings::register - Warnings import function

Standard Modules

Standard, bundled modules are all expected to behave in a well-defined manner with respect to namespace pollution because they use the Exporter module. See their own documentation for details.

It's possible that not all modules listed below are installed on your system. For example, the GDBM_File module will not be installed if you don't have the gdbm library.