summaryrefslogtreecommitdiff
path: root/dist/constant
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2014-08-25 22:05:37 -0700
committerFather Chrysostomos <sprout@cpan.org>2014-08-25 22:17:04 -0700
commitab8487cedd10a6f18f13043ee1e8fefb9a59e77f (patch)
tree9414dbe2332761d2fdd9f53270395bff055250c8 /dist/constant
parente6d9aa50648437da9c2e1f790a25e64e94bc5a30 (diff)
downloadperl-ab8487cedd10a6f18f13043ee1e8fefb9a59e77f.tar.gz
constant.pm: Document fully-qualified constant names
added a few commits ago.
Diffstat (limited to 'dist/constant')
-rw-r--r--dist/constant/lib/constant.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/dist/constant/lib/constant.pm b/dist/constant/lib/constant.pm
index 64a20ba64c..d03ab5f599 100644
--- a/dist/constant/lib/constant.pm
+++ b/dist/constant/lib/constant.pm
@@ -277,6 +277,13 @@ as C<< Some::Package->CONSTANT >> or as C<< $obj->CONSTANT >> where
C<$obj> is an instance of C<Some::Package>. Subclasses may define
their own constants to override those in their base class.
+As of version 1.32 of this module, constants can be defined in packages
+other than the caller, by including the package name in the name of the
+constant:
+
+ use constant "OtherPackage::FWIBBLE" => 7865;
+ constant->import("Other::FWOBBLE",$value); # dynamically at run time
+
The use of all caps for constant names is merely a convention,
although it is recommended in order to make constants stand out
and to help avoid collisions with other barewords, keywords, and