summaryrefslogtreecommitdiff
path: root/lib/constant.pm
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-05-14 07:00:02 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-05-14 07:00:02 +0000
commita3cb178b0bad32fa8be934503d051b96a3cb1fea (patch)
treebb5ab9c595a9158c059710be33d4e5ff619bf3fc /lib/constant.pm
parent43051805d53a3e4c5b2185a17655cab5bedc17ed (diff)
downloadperl-a3cb178b0bad32fa8be934503d051b96a3cb1fea.tar.gz
[win32] merge changes#872,873 from maintbranch
p4raw-link: @873 on //depot/maint-5.004/perl: 990f469d529b62458be38e8659885fd26d353629 p4raw-link: @872 on //depot/maint-5.004/perl: 0b85608df162729d39cb0f96c9f88c7de0a3ceab p4raw-id: //depot/win32/perl@935
Diffstat (limited to 'lib/constant.pm')
-rw-r--r--lib/constant.pm9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/constant.pm b/lib/constant.pm
index a0d4f9d5cd..464e20cd91 100644
--- a/lib/constant.pm
+++ b/lib/constant.pm
@@ -106,6 +106,15 @@ name as a constant. This is probably a Good Thing.
Unlike constants in some languages, these cannot be overridden
on the command line or via environment variables.
+You can get into trouble if you use constants in a context which
+automatically quotes barewords (as is true for any subroutine call).
+For example, you can't say C<$hash{CONSTANT}> because C<CONSTANT> will
+be interpreted as a string. Use C<$hash{CONSTANT()}> or
+C<$hash{+CONSTANT}> to prevent the bareword quoting mechanism from
+kicking in. Similarly, since the C<=E<gt>> operator quotes a bareword
+immediately to its left you have to say C<CONSTANT() =E<gt> 'value'>
+instead of C<CONSTANT =E<gt> 'value'>.
+
=head1 AUTHOR
Tom Phoenix, E<lt>F<rootbeer@teleport.com>E<gt>, with help from