You are viewing the version of this documentation from Perl 5.6.2. 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

  • 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 escape.

  • constant - Declare constants

  • diagnostics - Perl compiler pragma to force verbose warning diagnostics

  • 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

  • lib - Manipulate @INC at compile time

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

  • open - Set default disciplines 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

  • strict - Restrict unsafe constructs

  • subs - Predeclare sub names

  • utf8 - Enable/disable UTF-8 in source code

  • vars - Predeclare global variable names (obsolete)

  • 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.

AltStyle によって変換されたページ (->オリジナル) /