summaryrefslogtreecommitdiff
path: root/pod/perlmod.pod
diff options
context:
space:
mode:
authorJames E Keenan <jkeenan@cpan.org>2016-12-11 08:37:06 -0500
committerJames E Keenan <jkeenan@cpan.org>2016-12-11 08:37:06 -0500
commit0ee4a8bde32174274ad80c192e06b5e15d9d0ca4 (patch)
treec79a14c1cf7d4e8feff166e952e3fef2e09d51fb /pod/perlmod.pod
parentdf13534a362db9ee6def13689ce040e48c73a29a (diff)
downloadperl-0ee4a8bde32174274ad80c192e06b5e15d9d0ca4.tar.gz
Readability improvements.
Break one long paragraph into four. Break some long sentences in two. Correct one spelling error. Use POD formatting more consistently on 'package'. More for RT #129345
Diffstat (limited to 'pod/perlmod.pod')
-rw-r--r--pod/perlmod.pod20
1 files changed, 12 insertions, 8 deletions
diff --git a/pod/perlmod.pod b/pod/perlmod.pod
index 2a101b6758..c87a68d837 100644
--- a/pod/perlmod.pod
+++ b/pod/perlmod.pod
@@ -34,16 +34,19 @@ mechanisms for protecting code from having its variables stomped on by
other code: lexically scoped variables created with C<my> or C<state> and
namespaced global variables, which are exposed via the C<vars> pragma,
or the C<our> keyword. Any global variable is considered to
-be part of a namespace and can be accessed via a "fully qualified form",
-and conversly any lexically scoped variable is considered to be part of
+be part of a namespace and can be accessed via a "fully qualified form".
+Conversely, any lexically scoped variable is considered to be part of
that lexical-scope, and does not have a "fully qualified form".
+
In perl namespaces are called "packages" and
-the C<package> declaration instructs the compiler as to which
-namespace to prefix to C<our> variables and unqualified dynamic names, which both protects
+the C<package> declaration tells the compiler which
+namespace to prefix to C<our> variables and unqualified dynamic names.
+This both protects
against accidental stomping and provides an interface for deliberately
clobbering global dynamic variables declared and used in other scopes or
packages, when that is what you want to do.
-The scope of the package declaration is from the
+
+The scope of the C<package> declaration is from the
declaration itself through the end of the enclosing block, C<eval>,
or file, whichever comes first (the same scope as the my(), our(), state(), and
local() operators, and also the effect
@@ -51,11 +54,12 @@ of the experimental "reference aliasing," which may change), or until
the next C<package> declaration. Unqualified dynamic identifiers will be in
this namespace, except for those few identifiers that, if unqualified,
default to the main package instead of the current one as described
-below. A package statement affects only dynamic global
+below. A C<package> statement affects only dynamic global
symbols, including subroutine names, and variables you've used local()
on, but I<not> lexical variables created with my(), our() or state().
-Typically it is the first declaration in a file
-included by the C<do>, C<require>, or C<use> operators. You can
+
+Typically, a C<package> statement is the first declaration in a file
+included in a program by one of the C<do>, C<require>, or C<use> operators. You can
switch into a package in more than one place: C<package> has no
effect beyond specifying which symbol table the compiler will use for
dynamic symbols for the rest of that block or until the next C<package> statement.