X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fconstant.pm;h=906b7770d28fb1e3b0dd8d9099fa4cb5f1d097b6;hb=47a7661deb880b9c5c3ea4517c4908096fdff41f;hp=4b6c98b9d8d60dbac4520c34c36693d6559da0ad;hpb=6515510feccb8a3e58c1cc3bdc4ed4e4bc03984a;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/constant.pm b/lib/constant.pm index 4b6c98b..906b777 100644 --- a/lib/constant.pm +++ b/lib/constant.pm @@ -4,12 +4,13 @@ use strict; use warnings::register; use vars qw($VERSION %declared); -$VERSION = '1.11'; +$VERSION = '1.17'; #======================================================================= # Some names are evil choices. -my %keywords = map +($_, 1), qw{ BEGIN INIT CHECK UNITCHECK END DESTROY AUTOLOAD }; +my %keywords = map +($_, 1), qw{ BEGIN INIT CHECK END DESTROY AUTOLOAD }; +$keywords{UNITCHECK}++ if $] > 5.009; my %forced_into_main = map +($_, 1), qw{ STDIN STDOUT STDERR ARGV ARGVOUT ENV INC SIG }; @@ -167,7 +168,7 @@ read, more likely to be maintained (and maintained correctly), and far less likely to send a space probe to the wrong planet because nobody noticed the one equation in which you wrote C<3.14195>. -When a constant is used in an expression, perl replaces it with its +When a constant is used in an expression, Perl replaces it with its value at compile time, and may then optimize the expression further. In particular, any code in an C block will be optimized away if the constant is false. @@ -330,6 +331,20 @@ immediately to its left, you have to say C<< CONSTANT() => 'value' >> (or simply use a comma in place of the big arrow) instead of C<< CONSTANT => 'value' >>. +=head1 SEE ALSO + +L - Facility for creating read-only scalars, arrays, hashes. + +L - Facility for creating read-only variables. Similar to C, +but uses C instead of C. + +L - Make read-only variables via attribute + +L - Perl extension to the C scalar flag + +L - A selection of general-utility hash subroutines (mostly +to lock/unlock keys and values) + =head1 BUGS Please report any bugs or feature requests via the perlbug(1) utility. @@ -349,7 +364,7 @@ This program is maintained by the Perl 5 Porters. The CPAN distribution is maintained by SEbastien Aperghis-Tramoni EFE. -=head1 COPYRIGHT +=head1 COPYRIGHT & LICENSE Copyright (C) 1997, 1999 Tom Phoenix