New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unnecessary warning from constant.pm #7590
Comments
From siegel@zrz.tu-berlin.deThis is a bug report for perl from anno4000@lublin.zrz.tu-berlin.de, The constant pragma warns Constant name '_123_456' has unknown problems at... when you try to define a constant that begins with "_" and consists ... identifier, that is, a string beginning with a letter or underscore, seems to indicate the same. I suggest dropping the corresponding I had a little correspondence with Tom Phoenix about this, and he If you submit a patch to the Perl developers (via perlbug), I would ...so it's no problem when his address disappears along with the comment. Regards, Anno Inline Patch--- orig/lib/constant.pm Wed Nov 10 18:32:43 2004
+++ perl-5.8.5/lib/constant.pm Wed Nov 10 19:16:05 2004
@@ -71,11 +71,6 @@
} elsif ($forced_into_main{$name}) {
warnings::warn("Constant name '$name' is " .
"forced into package main::");
- } else {
- # Catch-all - what did I miss? If you get this error,
- # please let me know what your constant's name was.
- # Write to <rootbeer@redcat.com>. Thanks!
- warnings::warn("Constant name '$name' has unknown problems");
}
}
--- orig/lib/constant.t Wed Nov 10 18:32:43 2004
+++ perl-5.8.5/lib/constant.t Wed Nov 10 19:20:34 2004
@@ -14,7 +14,7 @@
######################### We start with some black magic to print on failure.
-BEGIN { $| = 1; print "1..82\n"; }
+BEGIN { $| = 1; print "1..83\n"; }
END {print "not ok 1\n" unless $loaded;}
use constant 1.01;
$loaded = 1;
@@ -249,3 +249,12 @@
test 80, @{+PHFAM} == SPIT->(THREE+1);
test 81, THREE**3 eq SPIT->(@{+FAMILY}**3);
test 82, AGES->{FAMILY->[THREE-1]} == PHFAM->[THREE];
+
+# Allow name of digits/underscores only if it begins with underscore
+{
+ use warnings FATAL => 'constant';
+ eval q{
+ use constant _1_2_3 => 'allowed';
+ };
+}
+test 83, length( $@) == 0;
---
Site configuration information for perl v5.8.1: Configured by anno4000 at Wed Oct 1 12:15:29 MEST 2003. Summary of my perl5 (revision 5.0 version 8 subversion 1) configuration: Locally applied patches: @INC for perl v5.8.1: Environment for perl v5.8.1: |
From @rgsAnno Siegel (via RT) wrote:
Thanks, applied as #23497 to bleadperl, after proper adjustment of the |
The RT System itself - Status changed from 'new' to 'open' |
@rgs - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#32400 (status was 'resolved')
Searchable as RT32400$
The text was updated successfully, but these errors were encountered: